I want to display a TimeSeriesChart with two range axis; one on the left and one on the right side of the chart. The two axis should be symmetric around zero so that zero lines of both axis are identical. Therefore I use the following code which works fine:
Code: Select all
/*symmetric axis around 0*/
double am0 = Math.max(Math.abs(myPlot.getRangeAxis(0).getLowerBound()),Math.abs(myPlot.getRangeAxis(0).getUpperBound()));
double am1 = Math.max(Math.abs(myPlot.getRangeAxis(1).getLowerBound()),Math.abs(myPlot.getRangeAxis(1).getUpperBound()));
Range adj0 = new Range(-1*am0,am0);
Range adj1 = new Range(-1*am1,am1);
myPlot.getRangeAxis(0).setRange(adj0);
myPlot.getRangeAxis(1).setRange(adj1);
How can I fix it? Any ideas?
Thanks for your help
Martin