quartile chart
quartile chart
Hi,
How do I make a quartile chart? The data values are min, 1st quartile, median, 3rd quartile, max for each category. The chart should look sort of like a floating vertical stacked bar chart (with four colors) or a high/low/open/close chart (with five tics). I tried both ways but didn't get very far. Any suggestions? Has it already been done?
Nish
How do I make a quartile chart? The data values are min, 1st quartile, median, 3rd quartile, max for each category. The chart should look sort of like a floating vertical stacked bar chart (with four colors) or a high/low/open/close chart (with five tics). I tried both ways but didn't get very far. Any suggestions? Has it already been done?
Nish
Re: quartile chart
Hi Nish,
Is this the 'box and whiskers' chart type where the box defines the lower and upper quartile range, and then there is a horizontal line through the box at the median plus a vertical line extending from the lowest data value to the highest data value? I guess the representation could vary, but I think I've seen this version.
That would be a nice addition to JFreeChart. Because of the special data requirements, I would recommend creating an extension of the CategoryDataset interface (call it something like QuartileCategoryDataset). Next, create a class that implements the interface (DefaultQuartileCategoryDataset). Then you would need to write a class that implements the CategoryItemRenderer interface to actually draw the data items.
One day (when I get time) I'll implement this...but I'll also be hoping that someone else does it sooner.
Regards,
DG.
Is this the 'box and whiskers' chart type where the box defines the lower and upper quartile range, and then there is a horizontal line through the box at the median plus a vertical line extending from the lowest data value to the highest data value? I guess the representation could vary, but I think I've seen this version.
That would be a nice addition to JFreeChart. Because of the special data requirements, I would recommend creating an extension of the CategoryDataset interface (call it something like QuartileCategoryDataset). Next, create a class that implements the interface (DefaultQuartileCategoryDataset). Then you would need to write a class that implements the CategoryItemRenderer interface to actually draw the data items.
One day (when I get time) I'll implement this...but I'll also be hoping that someone else does it sooner.
Regards,
DG.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Yes, JFreeChart has box-and-whisker plots for both the CategoryPlot and XYPlot classes now.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Stacked Bar-style quartile chart
Hi, Is there any way to get something like this:
(nevermind, it won't let me post the link - it's the floating bar chart the guy was talking about - in Excel you plot it something like this: =SERIES(QuartileData!$A$18,QuartileData!$B$13:$E$13,QuartileData!$B$18:$E$18,5), using a column chart)
It is a quartile chart, but they prefer the stacked-bar look, and I can't seem to figure that out.
Also, they have four quartiles and a median rather than three, which seems to be the case with the box and whisker chart.
Even if I could just fake it somehow - this is only benchmark data to go in the background. The real interest would be the overlaid line chart that represents the user's actual responses, which they can then compare to the bar charts in the background.
Thanks! I did by the user's guide and the demo code, it was very helpful, just not quite enough...
(nevermind, it won't let me post the link - it's the floating bar chart the guy was talking about - in Excel you plot it something like this: =SERIES(QuartileData!$A$18,QuartileData!$B$13:$E$13,QuartileData!$B$18:$E$18,5), using a column chart)
It is a quartile chart, but they prefer the stacked-bar look, and I can't seem to figure that out.
Also, they have four quartiles and a median rather than three, which seems to be the case with the box and whisker chart.
Even if I could just fake it somehow - this is only benchmark data to go in the background. The real interest would be the overlaid line chart that represents the user's actual responses, which they can then compare to the bar charts in the background.
Thanks! I did by the user's guide and the demo code, it was very helpful, just not quite enough...
Hi, just to give you more information on it, I did find another charting software (not as cool and open source like jfreechart) that called it a "box chart created by using 4 box layers, each handling one data series"
Perhaps it is not too hard to extend the Box and Whiskers chart to do boxes for the other two instead of whiskers? How would that work?
Or perhaps it would be easier to create a "Floating Bar Chart" where you can set where the bar rendering starts, then the heights of all the bars? Would that be hard?
Thanks,
Pam
Perhaps it is not too hard to extend the Box and Whiskers chart to do boxes for the other two instead of whiskers? How would that work?
Or perhaps it would be easier to create a "Floating Bar Chart" where you can set where the bar rendering starts, then the heights of all the bars? Would that be hard?
Thanks,
Pam
Last edited by nimowy on Fri Jan 25, 2008 11:25 pm, edited 1 time in total.
Hi, one more thing... looking at Box and Whisker, it looks like you have to give it all the raw values, but for my benchmark / comparison data, all I have is the already-calculated quartile ranges, along with the median. No mean available. Does Box and Whisker always rely on calculating this itself?
Thanks!
Pam
Thanks!
Pam
Never mind. I figured out how to set it using a BoxAndWhiskerItem. Thanks anyways.nimowy wrote:Hi, one more thing... looking at Box and Whisker, it looks like you have to give it all the raw values, but for my benchmark / comparison data, all I have is the already-calculated quartile ranges, along with the median. No mean available. Does Box and Whisker always rely on calculating this itself?
Thanks!
Pam
Hi, I figured out a way to do this. You can set the bottom bar to be the size you need the stacked bar to float. Then set the paint for that series to translucent. This way you can have a Floating Stacked Bar Chart, with each bar floating a different amount.nimowy wrote: Or perhaps it would be easier to create a "Floating Bar Chart" where you can set where the bar rendering starts, then the heights of all the bars? Would that be hard?
IE:
Code: Select all
StackedBarRenderer renderer1 = (StackedBarRenderer) plot.getRenderer();
Color transparent = new Color(1,1,1,1);
renderer1.setSeriesPaint(0, transparent);
Code: Select all
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(31,"",myTool.getProperty("CATEGORY1"));