ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Getting gridlines x/y
Posted by Dan on Feb-06-2017 23:40
Hi


Is it possible to find out the grid lines positions in the chart?

  Re: Getting gridlines x/y
Posted by Peter Kwan on Feb-07-2017 00:07
Hi Dan,

For XYChart objects, you can obtain the axis tick positions by using Axis.getTicks. Typically, the code structure is like:

.... set up the chart and enter all the data to the chart ....

'Tell ChartDirector it can auto-scale the axis now (as all the data have already been
'entered into the chart)
Call c.layoutAxes()

'An array of numbers representing the tick position in axis units
myTicks = c.yAxis().getTicks()

You may use XYChart.getYCoor if you need to have the coordinate in pixel units, like:

'Pixel coordinate of first tick
myTickYCoor = c.getYCoor(myTicks(0))

Hope this can help.

Regards
Peter Kwan

  Re: Getting gridlines x/y
Posted by Dan on Feb-07-2017 06:51
Thanks,


Working perfect!