We have a bunch of Category XY Bar charts (vertical) that we need to show one more piece of information to the user. We are currently using the DefaultCategoryDataset() class to do these...
These charts have N number of Clusters (Categories) and Y number of Series.
We need to show the current value for each of the category/series combinations (as a unique Bar, different color based on series)... It's doing that fine now.
But we would also like to show graphically the value from a prior period (a unique value for each category/series combination).
Ideally, for each category/series combination, you would see a vertical bar representing the current value, and overlaid over that bar, a little short horizontal line showing that respective metric's value from the prior period.
I'm looking for a suggestion regarding what type of chart to use to accomplish this. I was looking at the candlestick high-low-close stuff, but it seems overkill for what I'm trying to do. If you have suggestions and/or can point me in the way of sample code/demos/etc, I would very much appreciate it.
Need Suggestion regarding type of chart to use
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
You could add the prior values to a secondary dataset, then use a custom renderer to draw those values. It wouldn't be too hard to write the custom renderer, since you could just start with the BarRenderer class and instead of drawing a rectangle for the bar, just draw a line where the top of the bar would be.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Yes, an overlaid chart - see OverlaidBarChartDemo.java in the JFreeChart distribution for an example. The only thing missing in this demo is the custom renderer for the secondary dataset. If I get a chance tomorrow I'll try to put together a demo including the custom renderer.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
I've committed a new renderer (LevelRenderer.java) and demo (OverlaidBarChartDemo.java) to CVS for inclusion in the 0.9.16 release which hopefully will be released today (unless I find some major problems when testing the release). The new renderer still needs some work, but I think it is close to what you want.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

