How to implement a StackedHorizontalBarChart with dates on t

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

How to implement a StackedHorizontalBarChart with dates on t

Post by Nik Clare » Fri Nov 08, 2002 11:45 am

I have a requirement for a combination gantt/stackedhorizontalbar chart, what I mean is a gantt chart where the series are stacked, not on separate lines (essentially just a StackedHorizontalBarChart with dates on the x-axis instead of numbers).

Is there an easy way to do this?

I tried a quick hack changing the StackedHorizontalBarChart so it had a HorizontalDateAxis instead of a HorizontalNumberAxis and changing the DefaultIntervalCategoryDataset to use dates instead of numbers (as the GanttSeriesCollection) but this produced bizarre results, not at all what I wanted.

All suggestions greatly appreciated.
Nik

sebastian

Re: How to implement a StackedHorizontalBarChart with dates

Post by sebastian » Fri Nov 08, 2002 12:27 pm

HI

I solved this by making XYPlot with TimeSeries and BarRenderer, i somehow emulated the stacks by adding up the series values and plotting the bars over each other

hope this helps

Sebastian

Nik Clare

Re: How to implement a StackedHorizontalBarChart with dates

Post by Nik Clare » Fri Nov 08, 2002 4:26 pm

Thanks for the feedback Sebastian.

In the end I solved this by using the GanttSeriesCollection as normal and making a couple of minor changes to the HorizontalIntervalBarRenderer so it renders all the bars at the same height.

This works perfectly.
Nik

Locked