Author |
Topic |
|
martin.rooney
3 Posts |
Posted - 16 Dec 2010 : 11:19:24
|
I have the following graph: - 1 TimeAxis (x) initially set to a 1 hour scale - 2 LinearAxis (y), 1 left and 1 right with different scales - right y-axis is set to the right hand side by: - .setAxisIntercept(xAxis.getAxisMax()) Everything, including axes labels are displayed correctly.
User intervention changes the time scale from 1 to 1.5 hours, but when I call setAxisIntercept again it has no impact, the right y-axis moves back with the time.
I have tried various methods to set the scale so that setAxisIntercept corrects this, but none have worked (setTimeCoordinateBounds, setScaleStop, setTimeAxisMax, setAxisLimits, etc).
It seems that I am missing a step before setAxisIntercept will interpret the changes correctly, I would be grateful for any input as to what this might be. |
|
quinncurtis
1586 Posts |
Posted - 16 Dec 2010 : 12:39:20
|
After you change the intercept, you must call the ChartView repaint (or updateDraw) method, to redraw the graph using the new intercept. See the examples in the example program MultipleAxes. Are you doing that?
From MultipleAxes.FinOHLCPlot.updateScaleAndAxes
yAxis3.calcAutoAxis(); yAxisLab3.calcAutoAxisLabels(); yAxis3.setAxisIntercept(pTransform3.getStopX()); yAxis3.setAxisTickDir(ChartConstants.AXIS_MAX);
this.repaint(); |
|
|
martin.rooney
3 Posts |
Posted - 16 Dec 2010 : 16:38:48
|
Thanks, it was the calcAutoAxis and calcAutoAxisLabels calls that I was missing. I was already calling the repaint() method. |
|
|
|
Topic |
|
|
|