Abdullah Ahmed
Abdullah Ahmed

Reputation: 31

JfreeCharts specify a particular width for XYBarchart

I am using JfreeCharts to make a XYBarChart and I would like to specify a particular width for the chart. From what I understand from the forums this is not possible. Is this truely the case?

I have tried:

changing the lowerMargin and upperMargin of the horizontal axis.

using renderer.setMargin() (renderer was accessed using chart.getPlot().getRenderer)

However, this has not worked.

Upvotes: 0

Views: 283

Answers (2)

trashgod
trashgod

Reputation: 205785

As an alternative to setSize(), you can specify the desired parameters in your ChartPanel constructor, as shown here.

Upvotes: 1

Baldrick
Baldrick

Reputation: 24340

You can set the size of the container of the chart (the ChartPanel if you're using Swing, the ChartComposite if you're using SWT, ...)

Upvotes: 1

Related Questions