ComponentOne Chart 8.0 for ActiveX
Picking Data Points

 

Picking Data Points

To determine the closest data point to a set of pixel coordinates, call CoordToDataIndex:

Dim Row As Long

Dim Column As Long

Dim Distance As Long

Dim Region As Integer

...

With Chart3D1.ChartGroups(1)

       Region = CoordToDataIndex 225, 92, Row, Column, Distance

End With

CoordToDataIndex returns the row and column of the closest data point, and returns the distance in pixels between the pixel coordinates and the point. CoordToDataIndex returns, as its return value, the region of the chart in which the pixel coordinates are located. This region is represented as a region constant. When the returned region is oc3dRegionInLegend, the returned point value is also set to oc3dRegionInLegend, and the returned series is the closest element in the legend. For Scatter Plot charts, mouse selection of individual legend entries is detected using the pick functionality. The “Row” parameter of CoordToDataIndex is set to the corresponding series when an entry is picked inside the legend.

The DragZValue method enables you to change the Z-value of any point on the grid. For example, the following changes the Z-value of the point in the second row and third column to the pixel coordinates (225,92):

With Chart3D1.ChartGroups(1)

       .DragZValue 2, 3, 225, 92

End With

The DragZValue method can be used to interactively drag a point to a new coordinate, as in the surface demo program.

The SurfaceValue method enables you to determine the Z-value of any point on the chart surface. For example, the following code determines the Z-value of the data coordinates (106,84):

Dim Zvalue As Double

...

With Chart3D1.ChartGroups(1)

       Zvalue = .SurfaceValue 106, 84

End With

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback