Hi,
I used setItemMargin method but depending on number of bars distance between bars changes..
But I want no space between bars..
anyone can help me reply ASAP
I don;t want space betwwin items of barchart
-
- Posts: 36
- Joined: Thu Apr 12, 2007 6:54 am
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You can set the item margin in the renderer and the category margin on the axis. See "Controlling the Width of Bars" in the BarRenderer section of the JFreeChart Developer Guide.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 36
- Joined: Thu Apr 12, 2007 6:54 am
This is what I'm doing, still big gaps between the bars as they get packed in tight. I was thinking that maybe I was drawing a bar outline in white, but doesn't look that way...
XYBarRenderer r1 = new XYBarRenderer();
r1.setMargin(0);
DateAxis domain1Axis = new DateAxis(xaxis1name);
domain1Axis.setAutoRange(true);
domain1Axis.setLowerMargin(0);
domain1Axis.setUpperMargin(0);
XYBarRenderer r1 = new XYBarRenderer();
r1.setMargin(0);
DateAxis domain1Axis = new DateAxis(xaxis1name);
domain1Axis.setAutoRange(true);
domain1Axis.setLowerMargin(0);
domain1Axis.setUpperMargin(0);
Re: I don;t want space betwwin items of barchart
u r talking abt the height of each bar and the spacing. if u really got it let me know. i am desperately in need of that.asha wrote:Hi,
I used setItemMargin method but depending on number of bars distance between bars changes..
But I want no space between bars..
anyone can help me reply ASAP
PraDz
--------------------------------
Cheers
PraDz
Cheers
PraDz
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
The XYBarRenderer determines the width of the bars from the values returned by the IntervalXYDataset - the starting x-value and the ending x-value. It may then shrink that interval a little according to the margin setting, but you've set that to zero already. So you need to look at your dataset values and figure out why the ending x-value from one data item (bar) isn't aligning with the starting x-value for the next data item (bar).Andrew Foss wrote: XYBarRenderer r1 = new XYBarRenderer();
r1.setMargin(0);
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 36
- Joined: Thu Apr 12, 2007 6:54 am
That will do it thanks...
I'm using a timeseries and don't have much control over the sampling rate, but I can duplicate samples, each of which is an 3 minute average, so I can fill up the 3 minute slot w/ average numbers, thank you.
I also did a modified XYRendererFill that fills below and allows gradient paint and I get the desired result that way, also, which is a smoothly filled in chart.
I also did a modified XYRendererFill that fills below and allows gradient paint and I get the desired result that way, also, which is a smoothly filled in chart.