Author |
Topic  |
|
javaman
22 Posts |
Posted - 01 Dec 2009 : 20:38:56
|
Hey All,
I have a requirement where I need to autoScale one axis and not the other. I'm using the TimeCoordinates class' autoScale method (for reference). Near as I can tell, it only works on both axes - not just one. My questions are as follows:
1) Is it possible to autoScale only one axes? From what I can tell from reading the documentation, the constants passed in either a) apply the same single constant to both (for the single constant method call) or b) enter two constants and one gets applied to x and one get applied to y axis respectively.
2) If 1) above is feasible/doable, can someone show me some code that implements autoscaling in say the Y-Axis while manually setting the X-Axis?
Any help would be appreciated.
many thanx.
Thanx - Joe! |
|
quinncurtis
1164 Posts |
Posted - 02 Dec 2009 : 10:58:37
|
There is a version of the autoScale method which takes two auto-scale parameters. The example below auto-scales the y-axis but not the x-axis of the coordinate system.
TimeCoordinates simpleTimeScale = new TimeCoordinates(); simpleTimeScale.autoScale(dataset,ChartConstants.NO_AUTOSCALE, ChartConstants.AUTOAXES_FAR);
Scale the x-axis explicity
simpleTimeScale.setTimeScaleStart(new GregorianCalendar(1996,1,5)); simpleTimeScale.setTimeScaleStop(new GregorianCalendar(1997,1,5));
See page 96-101 of the QCChart2D manual |
 |
|
javaman
22 Posts |
Posted - 02 Dec 2009 : 15:21:15
|
I knew about that constant - NO_AUTOSCALE - but from your own documentation (source code ):
(in ChartConstants.class)
// Auto Axes Type Constants /** * Auto-scale round mode set is none, for internal use only, no rounding may occur, may not work under all conditions */ public final static int NO_AUTOSCALE = 3;
Your own code says not to trust this - or use it. So which is it?
Thanx - Joe! |
 |
|
quinncurtis
1164 Posts |
Posted - 02 Dec 2009 : 16:17:36
|
As far as I know, the NO_AUTOSCALE is valid. But if you are concerned, don't use it, just auto-scale the x-axis using ChartConstants.AUTOAXES_FAR, and change it to whatever you want after the auto-scale. The result is exactly the same.
TimeCoordinates simpleTimeScale = new TimeCoordinates(); simpleTimeScale.autoScale(dataset,ChartConstants.AUTOAXES_FAR, ChartConstants.AUTOAXES_FAR);
Scale the x-axis explicity
simpleTimeScale.setTimeScaleStart(new GregorianCalendar(1996,1,5)); simpleTimeScale.setTimeScaleStop(new GregorianCalendar(1997,1,5)); |
 |
|
|
Topic  |
|
|
|