Stacked horizontal bar chart with IntervalCategoryDataset?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Don Brown

Stacked horizontal bar chart with IntervalCategoryDataset?

Post by Don Brown » Tue Nov 05, 2002 9:13 pm

Would there exist a way to have a stacked horizontal bar chart use a IntervalCategoryDataset? For each category, I want a line like:
xxxxxxxxxyyyzzzzzzzzzzzzzz
where x, y, z are series.

If no way currently exists, could you give an estimate of how long it might take to add it? Thanks for the help.

Don

Dave Gilbert

Re: Stacked horizontal bar chart with IntervalCategoryDatase

Post by Dave Gilbert » Wed Nov 06, 2002 6:47 pm

You can create stacked horizontal bar charts using a regular CategoryDataset. See the createStackedHorizontalBarChart(...) method in the ChartFactory class.

Regards,

DG

Don Brown

Re: Stacked horizontal bar chart with IntervalCategoryDatase

Post by Don Brown » Wed Nov 06, 2002 8:11 pm

True, however the current stacked horizontal bar seems to reorder the series. I need series 1 to always follow series 2 for example. The result would be more like a timeline than a simple aggregation. Make sense?

Don

Dave Gilbert

Re: Stacked horizontal bar chart with IntervalCategoryDatase

Post by Dave Gilbert » Fri Nov 08, 2002 12:36 am

The only reordering is that negative values are displayed to the left of zero, and positive values are displayed to the right of zero. Otherwise, the series should be plotted in order. If that is not happening, it is a bug.

Regards,

DG

Don Brown

Stoplight graph

Post by Don Brown » Fri Nov 22, 2002 9:10 pm

Here's my problem: I need to do a "stoplight" chart for multiple systems, one system per y position. Say the range is 0 to 100. I need to graph for a given system 0-10=red, 10-60=yellow, 60-100=green. The range could be include negative values depending on the unit. Any idea how to do this?

Thanks again for the help.

Don

Don Brown

Re: Stoplight graph FIXED

Post by Don Brown » Wed Nov 27, 2002 10:21 pm

If anyone is interested, I was able to get the following type of graph to work:

RRRRYYYYYYYYGGGGGGGGGGGGGGG

Where R is red, Y is yellow, and G is green.

I took HorizontalIntervalBarRenderer, copied it as StackedHorizontalIntervalBarRenderer, and made some modifications. I had barWidthsPerCategory() return 1, and commented out line 217 (0.9.4), thus ending the expression on line 215.

This forced the series to paint over each other, thus creating my stoplight graph. And there was much rejoycing.

Don

Locked