Hi ET,
(1) You may set the y-axis scale using Axis.setLinearScale. For example:
c.yAxis().setLinearScale(60, 100, 10);
c.yAxis().setLabelFormat("{value}%");
(2) If the axis scale is set by your code (eg. using Axis.setLinearScale above), you can set
the axis scale to contain your mark line. In this way, the mark line will always be visible.
If your mark line is using an axis that is auto-scaled by ChartDirector, by default,
ChartDirector will scale the axis based on the data values in all the data layers. To ensure
the mark line is within the axis scale, you may add a transparent data layer with the data
value of the mark line. For example:
// make sure the right y-axis contains markValue
c.addLineLayer(new double[] { markValue }, Chart.Transparent).setUseYAxis2();
c.yAxis2().addMark(markValue, 0xff0000);
Hope this can help.
Regards
Peter Kwan |