Hi All
I need to set fixed space between Boxplot items. I'm using BoxAndWhiskerXYDataset and XYBoxAndWhiskerRenderer, in the renderer I don't see any option to set a fixed distance between Boxplot items. With Scatterplot we can set the space using XYSeries's add method where the 1st parameter is to set the distance, I need something like this. Does anyone have any idea about this? Thanks
--Rashed
Setting fixed space between boxplot items
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Setting fixed space between boxplot items
There is a boxWidth attribute in the renderer that lets you set a fixed width for the boxes, but the distance between boxes will depend on the x-value and scale on the x-axis. I don't think there is a good general solution for what you want to do, sorry.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
Re: Setting fixed space between boxplot items
Yes, it was not possible straight but I managed to fix the space finally. Investigating drawVerticalItem method of XYBoxAndWhiskerRenderer class I targeted to control the xx value by my logic and it's working nice now, The changes are as follows:
double initX = Constants.DEFAULT_INIT_X_VALUE; // starting x value
double xx = 0;
if (item == 0) {
xx = initX;
// domainAxis.valueToJava2D(x.doubleValue(), dataArea,
// plot.getDomainAxisEdge());
} else {
xx = initX + (item * Constants.X_VALUE_GROW_BY); // dynamically setting space
}
Along with this I'm now controlling XYLineAndShpaRenderer too because my target was to show all rwadata over boxplot, both are working nice. Thanks
double initX = Constants.DEFAULT_INIT_X_VALUE; // starting x value
double xx = 0;
if (item == 0) {
xx = initX;
// domainAxis.valueToJava2D(x.doubleValue(), dataArea,
// plot.getDomainAxisEdge());
} else {
xx = initX + (item * Constants.X_VALUE_GROW_BY); // dynamically setting space
}
Along with this I'm now controlling XYLineAndShpaRenderer too because my target was to show all rwadata over boxplot, both are working nice. Thanks