I might be missing something obvious here, but I've pored over the API for about 20 minutes and nothing is clicking.
Basically I'm trying to make a "publication quality" chart, which by some definitions requires the number of labels/ticks to be few. For instance, I'd like 4 ticks on the y-axis and 5 ticks on the x-axis.
However, I don't want to set the tick unit manually. I'd like for the proper tick units to be generated for whatever range of values that happen to be in the data set. So if the range is 0 - 100, the ticks would be at 25, 50, 75, 100 but if the range was 0 - 1000, the ticks would be at 250, 500, 750, 1000 etc.
Anyways, I just thought I'd float this question in the forums. Otherwise I'll dig deeper in the API tomorrow. And possibly dig in the code, but I hate digging into code.
-jw
Axis - setting the number of labels/ticks
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The dynamic tick unit selection code will try to display as many ticks as possible (always selecting from a predefined collection of "standard" units) without the labels overlapping. One way to encourage fewer ticks is to use the setTickLabelInsets(...) method to increase the space around the tick labels - the only problem is that the insets are specified in absolute units, so if your charts are resizable it won't be an ideal solution.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

