Following is part of my code creating a bar chart:
.......................
for(int k=0;k<numR;k++){
dataset.addValue(Double.valueOf(filteredData[k]), xArrayData[k], ""+k);
}
................................
When the XY bar graph is created the width of the bar is very small just like a small line. I wanted to fix the minimum width of the bar say 1 cm. How can I do it?
Thanks in advance;
Ranjan Yengkom
Minimum BAR Width of XYBar Chart
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Minimum BAR Width of XYBar Chart
The XYBarRenderer derives the bar width from the dataset's getStartXValue() and getEndXValue() methods. Which dataset implementation are you using? Maybe you can override the x-interval values...
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Re: Minimum BAR Width of XYBar Chart
Hi, i'm using XYBarRenderer and i dont know how can i set fixed bar with. Setting bar width in percentage is not good, because sometimes i have data like [1.121 1.122 1.123 1.124] and sometimes like [83 84 85] so
is not cool in my case because with different data i have different bar width, so could someone explain to me how can i solve this?
Thanx)
Code: Select all
renderer.setMargin(0.99);
Thanx)
Re: Minimum BAR Width of XYBar Chart
XYBarDataset defines this method
Code: Select all
public void setBarWidth(double barWidth)
Re: Minimum BAR Width of XYBar Chart
thanx, so how about XYSeriesCollection. is there any way to set fixed width, i'm totally cofused about it right now 
