Hello,
I have a requirement to display a vertical bar chart for a set of data. JFreechart makes this very simple to do.
However, I have a customization I cannot seem to figure out. How can a bar for a category begin at a negative number and at end at a greater number? In other words, my bars alway begin at 0 and are drawn downward to negative numbers. I would like to begin at say -80 and head upward to say -10. Does anyone have an idea the best way to approach this?
Thanks,
-Russ.
Vertical Bar Chart ?
Re: Vertical Bar Chart ?
The CategoryDataset interface only returns a single value, but you need two values for what you want to do. So you need to use IntervalCategoryDataset which is an extension of CategoryDataset. Then you need a renderer that knows what to do with the extra data - use VerticalIntervalBarRenderer.
There is a demo called IntervalBarChartDemo that shows how this is put together.
Regards,
Dave Gilbert
There is a demo called IntervalBarChartDemo that shows how this is put together.
Regards,
Dave Gilbert
Re: Vertical Bar Chart ?
David,
Thanks for the advice. I will give this a shot and let you know how it worked out.
BTW, thank you for this nice graphing package. I also purchased the help doc, which clarified quite a few things for me.
-Russ.
Thanks for the advice. I will give this a shot and let you know how it worked out.
BTW, thank you for this nice graphing package. I also purchased the help doc, which clarified quite a few things for me.
-Russ.