Hi,
I would like to know if it is possible to set the minimum amount
of TickUnits shown on a ValueAxis in a XYPlot.
I am using my own StandardTickUnits, via the setStandardTickUnits
method on the ValueAxis.
I noticed that then calculateVisibleTickCount in NumberAxis always returns
1 for a certain set of data and image size, regardless of the number of datapoints in the series.
Is this behaviour possible to change?
Regards,
Nick
set Minimum tick unit count
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
No. The auto tick unit selection mechanism will choose the smallest tick unit---from your collection of "standard" units---that it can display without the labels overlapping.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


The chart just looks really wierd with only one tick-unit value displayed.david.gilbert wrote:No. The auto tick unit selection mechanism will choose the smallest tick unit---from your collection of "standard" units---that it can display without the labels overlapping.
This is usually 0, and then punters have no other point of reference
for the line. Is there a way to maybe scale the axis so that you
get at least two labels showing?
Cheers,
Nick
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You said you specified your own standard tick units - try adding a smaller tick unit to your collection.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Right, but when I add the tick units, I do not know the size the of the graph, size of the labels etc. All this gets done at renering time in NumberAxis in the method: calculateVisibleTickCount. If this method returns < 2, then it would be good if the chart could rescale, so that at least two Tick Units are visible.david.gilbert wrote:You said you specified your own standard tick units - try adding a smaller tick unit to your collection.
Does this make sense?