ComponentOne Chart 8.0 for ActiveX
Converting Data Coordinates to Pixel Coordinates

 

Converting Data Coordinates to Pixel Coordinates

To convert from data coordinates to screen pixel coordinates, call the DataCoordToCoord method. For example, the following code obtains the pixel coordinates corresponding to the data coordinates (5.1, 10.2):

Dim PixelX As Long

Dim PixelY As Long

With Chart2D1.ChartGroups(1)

       .DataCoordToCoord 5.1, 10.2, PixelX, PixelY

End With

' PixelX and PixelY now contain the pixel coordinate value

If the data coordinate is out of the visible range of the chart, both of the pixel X- and Y-coordinates are set to -1.

 

 


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

Product Support Forum  |  Documentation Feedback