0

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.

Baldrick
  • 23,882
  • 6
  • 74
  • 79

2 Answers2

1

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, ...)

Baldrick
  • 23,882
  • 6
  • 74
  • 79
1

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

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045