0__
0__

Reputation: 67280

Adjust horizontal (preferred) size of an XYPlot in JFreeChart

I have an XYPlot with an XYBarRenderer. This is used for a histogram. The horizontal spacing between the bins is too large, the bars are too wide. How can I decrease the 'preferred' bar width in this setting?

Note that setMaximumBarWidth is not defined for XYBarRenderer.

Upvotes: 0

Views: 162

Answers (1)

David Gilbert
David Gilbert

Reputation: 4477

By default the XYBarRenderer will take its dimensions from the dataset which, in your case, will be determined by the actual bin widths. For presentation, you can override that and trim the bar widths down a little (or a lot) by calling the setMargin() method.

Upvotes: 1

Related Questions