I created Vertical Bar Chart. There are 9 bars with range of 92.5 to 94.1. The problem is that there are only 2 RangeAxis appears. Is there anyway that I can add more RangeAxis like .5 interval?
// set the Axis
VerticalNumberAxis vnAxis1Monthly = (VerticalNumberAxis) chartPlotMonthly.getRangeAxis();
vnAxis1Monthly.setUpperMargin(.1);
vnAxis1Monthly.setAutoRangeIncludesZero(false);
// set the Range Axis Vaule to Integer.
NumberAxis rangeAxis = (NumberAxis) chartPlotMonthly.getRangeAxis();
TickUnits units = NumberAxis.createIntegerTickUnits();
rangeAxis.setStandardTickUnits(units);
Range Axis
Re: Range Axis
Those last three lines in your code force the axis to use integers only, so you will only see "93" and "94" for your tick labels. Comment out that code, and you will see more tick marks and labels...
Regards,
Dave Gilbert
Regards,
Dave Gilbert
Re: Range Axis
that what I thought. The reason I add the IntegerTickUnits is because sometime it display 4 or 5 decimal places. I don't mind one decimal place but how can I make the code to force to make 1 decimal places?
Re: Range Axis
Use almost the same code, but instead of createIntegerTickUnits() insert some code that creates your own TickUnits collection.
You could probably copy the code in createStandardTickUnits(), and just delete all the tick sizes that are outside the range that you want to see.
Regards,
Dave Gilbert
You could probably copy the code in createStandardTickUnits(), and just delete all the tick sizes that are outside the range that you want to see.
Regards,
Dave Gilbert