Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart2D for Java
 setAxisIntercept Problem
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

martin.rooney

3 Posts

Posted - 16 Dec 2010 :  11:19:24  Show Profile  Reply with Quote
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  Show Profile  Reply with Quote
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();
Go to Top of Page

martin.rooney

3 Posts

Posted - 16 Dec 2010 :  16:38:48  Show Profile  Reply with Quote
Thanks, it was the calcAutoAxis and calcAutoAxisLabels calls that I was missing. I was already calling the repaint() method.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07