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
 Major and Minor Ticks on Time based x-axis
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

martin.rooney

3 Posts

Posted - 04 Oct 2011 :  09:55:22  Show Profile  Reply with Quote
From what I have seen this does not look possible, but I have had a request for the following:
- graphs are displayed with time on the x-axis
- displayed graphs can be viewed at various resolutions e.g. 30min, 1h, 1h30 2h, etc.
- for each resolution:
- 4 major ticks
- 3 minor ticks per major tick

This would result in many of the ticks corresponding to fractions of minutes.

I have looked at method setAxisTickMarkTimeBase and it looks like there are a fixed set of constants that can be passed in here.
Is there an alternative to this that would allow this scheme to be implemented?

quinncurtis

1585 Posts

Posted - 04 Oct 2011 :  10:45:34  Show Profile  Reply with Quote
I don't see any way to do it using TimeCoordinates and a TimeAxis. The time axes must fit one of our preset formats.

You could use CartesianCoordinates, LinearScale and NumericAxisLabels. Just scale the linear x-axis for minutes. You can easily set that up for 4 major tick marks, with 3 minor in between.

xAxis.setAxisTickSpace( (pTransform1.getScaleMaxX()- pTransform1.getScaleMinX())/12);
xAxis.setAxisMinorTicksPerMajor(3);

You would see a numeric axis labels (90.0 for 90 minutes) instead of the time formatted axis labels (1:30).
Go to Top of Page

quinncurtis

1585 Posts

Posted - 04 Oct 2011 :  12:33:16  Show Profile  Reply with Quote
If you do not need absolute time/date, and can use just elapsed time, you should be able to do what you want using ElapsedTimeCoordinates, ElpasedTimeAxis and ElapsedTimeAxisLabels. See the example NewDemosRev2.ElapsedTimeChart. You can set the tick marks the same as the linear axis example above.

ElapsedTimeAxis xAxis = new ElapsedTimeAxis(pTransform1, ChartObj.X_AXIS);
xAxis.setAxisTickSpace( (pTransform1.getScaleMaxX()- pTransform1.getScaleMinX())/12);
xAxis.setAxisMinorTicksPerMajor(3);
chartVu.addChartObject(xAxis);

The tick mark settings will not stick if you use zooming. So you will need to select different axis ranges some other way (buttons, or menu selection)
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