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

Message ListMessage List     Post MessagePost Message

  Cross hair
Posted by srinivas on Aug-12-2016 17:20
Hi,
    I implemented finance chart with track line and cross hair features. Every thing working fine But I want to display cross hair values on 3-sides(two Y-axis's and one X-axis). Is it possible? if possible please provide solution.

Thanks.

  Re: Cross hair
Posted by Peter Kwan on Aug-12-2016 22:59
Hi srinivas,

In the original cross-hair sample code included in ChartDirector, there are around 3 lines of code that draws the xAxis label (where xAxis is set to c.xAxis()), and another 3 lines of code for the yAxis (set to c.yAxis()).

To draw a label on the other y-axis, please add repeat the y-axis code with yAxis2 = c.yAxis2().

The above should draw the label on the other y-axis, but in my opinion, this may not be necessary if no data is using the second y-axis. (In some indicator charts, the second y-axis may not be used.) You may consider to iterate the data sets to check if there is a date set using the second y-axis before decided to put a label on the second y-axis. (The other track line examples demonstrates how to iterate all the layers in all data sets.)

Also, in the main price chart, the second labelled part of the second y-axis can be quite short. You may want to check if the crosshair value is between the Axis.getMaxValue and Axis.getMinValue and not drawing the axis label if it is outside the min and max label range.

Regards
Peter Kwan

  Re: Cross hair
Posted by srinivas on Aug-16-2016 13:23
Thank you very much Peter Kwan. It helped me a lot