TdxChartHitTest.Value Property
Returns the value on the primary Y-axis that corresponds to the inspected point position within the plot area of an XY diagram.
Declaration
property Value: Variant read;
Property Value
Type | Description |
---|---|
Variant | The value on the main axis of values that corresponds to the inspected point within the plot area of an XY diagram. This property returns |
Remarks
Use Argument and Value
properties to obtain the coordinates of the inspected point within the plot area of an XY diagram in corresponding measurement units of the main X and Y axes.
To obtain the coordinates of the inspected point on any primary or secondary axis, call the GetAxisCoordinate function.
Code Example
The following code example demonstrates an OnMouseMove event handler that displays mouse pointer coordinates (in axis measurement units) in the application form caption:
uses dxChartControl;
// ...
procedure TMyForm.dxChartControl1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if dxChartControl1.HitTest.Diagram <> nil then
begin
if (dxChartControl1.HitTest.Argument <> VarNull) and (dxChartControl1.HitTest.Value <> VarNull) then
Caption := Caption + 'X: ' + VarToStr(dxChartControl1.HitTest.Argument) +
' Y: ' + VarToStr(dxChartControl1.HitTest.Value);
end;
end;
To obtain horizontal and vertical coordinates (in pixels) of the inspected point within the Chart control client area, use the Point property.
Chart HitTest Information Updates
Chart HitTest information updates every time when:
- The OnHotTrackElement or OnMouseMove event occurs.
Point
.X andPoint
.Y property values change to the corresponding mouse pointer coordinates. - You call the CalculateHitTest procedure.
Point
.X andPoint
.Y property values change to the procedure’sX
andY
parameter values.
Argument and Value
property values change to corresponding coordinates (in axis measurement units) if the inspected point is within the plot area of an XY diagram.