1

I am using JFreeChart to create a BarChart. My question: is there a way to set the uppermargin of the graph to stop at the next interval? As an example, say a Bar Graph is made with range intervals of 5. Say the tallest bar ends at 30. Is there a way automatically set margins to make the graph go vertically until 35-the next interval? I know there is a setUpperMargin method but that requires inputting double values until one achieves the upper range he wants. Instead, is there a way to just set the margin to go for another interval after the end of the bar graphs? Thank you.

1 Answer 1

1

Query your chosen CategoryDataset for the maximal range value and use setUpperBound() on the range axis. BarChartDemo1, included in the distribution, shows how to reference an axis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.