Bar width in verticalbar chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
nurettin
Posts: 2
Joined: Mon Aug 04, 2003 8:25 am

Bar width in verticalbar chart

Post by nurettin » Mon Aug 04, 2003 8:33 am

How can I can the bar width in verticalbar chart?

nurettin

Guest

Re: Bar width in verticalbar chart

Post by Guest » Mon Aug 04, 2003 9:38 am

nurettin wrote:How can I can the bar width in verticalbar chart?

nurettin
Unfortunately you can't :( The renderers auto-calculate this for you based on the width of the chart, the amount of data to be plotted and the margins. I have worked around this by varying the width of the chart based on the amount of data but it is a far from ideal solution.
Lot's of people have asked for this feature now, I wonder if it would be possible to sub-class the vertical bar chart and produce one where you can specify this ?

j
Posts: 14
Joined: Tue Jul 22, 2003 12:56 pm

seeting bar width is vertical bar chart

Post by j » Mon Aug 04, 2003 11:59 am

there is no direct method. coz it auto caluclates based on the foll values. so just manipulate these 3 values and set the bar width as u want.these values are currently based on what i have set for my chart my chart.

CategoryAxis domainAxis=plot.getDomainAxis();
domainAxis.setCategoryMargin(0.3);
domainAxis.setUpperMargin(0.15);
domainAxis.setLowerMargin(0.05);

Locked