How to increase or decrease width of bar chart


I had one bar chart. When i am categorizing the bar chart by Category Expression, then the width of chart truncated. Can you please tell me how to get rid of this. Thanks in Advance.

sarojkumar.silicon's picture
Joined: Apr 13 2014 - 9:40am
Last seen: 1 year 9 months ago

3 Answers:


You should create a barchart customizer class to control width of bar chart and use the setMaximumBarWidth attribute

CategoryPlot categoryPlot=chart.getCategoryPlot();
BarRenderer renderer=(BarRenderer)categoryPlot.getRenderer();
renderer.setMaximumBarWidth(.30);  //Set maximum width of barchart to 30 percent

aamitt06's picture
Joined: Jun 23 2014 - 5:48am
Last seen: 3 years 4 months ago

How to create Customizer class for this bar chart. Can you please tell me about briefly. Thnk you so much for quick reply.

sarojkumar.silicon - 5 years 2 weeks ago

Go through this link you will get idea how to create customizer class and integrate it with charts

aamitt06 - 5 years 1 week ago

I had the same issue when I categorizing the bar.

It too me a while and I also tried the above anser that didn't help me.

I found out that you can put empty string in the Series and that solve the issue




omer.etrog's picture
Joined: Aug 31 2017 - 3:08pm
Last seen: 1 year 5 months ago

omer.etrog, problem with this solution is the color, you can only use one color in all bars. 

Hugo Mota's picture
Joined: Jul 24 2018 - 11:43am
Last seen: 3 weeks 5 days ago