|
Y-axis |
Posted by Autoscale Y-axis when zooming on Nov-02-2016 11:23 |
|
Good day.
i use version 6.1, programming language C# WinForm, operation system Windows 8.1 x64.
please help to understand, i use for limiting minimum and maximum Y-axis chartArea.yAxis().setAutoScale(0.01, 0.01, 0.01);, but if i use zoomIn or zoomOut the axis of the border as before.
me need so that axis borders adjust to maximum and minimum values in the visible region when zooming.
how can i do that?
Thanks very much
Eferov Ivan |
Re: Y-axis |
Posted by Peter Kwan on Nov-03-2016 00:35 |
|
Hi Eferov,
If the y-axis is auto-scaled, it is always scaled according to the data values passed to the chart.
In the Windows Forms sample code, there is an example called “Simple Zooming and Scrolling”. When you drag to scroll the chart, you can see the axis scale changes. You can also add c.yAxis().setAutoScale(0.01, 0.01, 0.01); to the code, and try again. The y-axis scale will change even more as your drag the chart.
Note that for auto-scaled axis, the scale will be based on the data passed to ChartDirector. In the “Simple Zooming and Scrolling”, only the visible data are passed to ChartDirector (the viewPortDataSeriesA, viewPortDataSeriesB, viewPortDataSeriesC and viewPortTimeStamps), so the axis is scaled based on the visible data.
For your case, if the axis scale does not appear to change when you scroll the chart, please check the followings:
(a) Are you passing only visible data to the chart?
(b) Is the axis auto-scaled? (Do you have another line that calls setLinearScale to scale the axis?)
(c) Is the Axis.setAutoScale called before the chart or track line is drawn?
If the above still does not solve the problem, is it possible to email me more complete code, and also provide a screen shot for the chart which you think is not auto-scaled correctly?
Regards
Peter Kwan |
|