I'm struggling - I have the documentation and searched the web to solve what I think is a simple problem. Maybe I'm just dense. I want to draw a vertical bar chart of numeric y data versus numeric x data. I believe the IntervalXYDataset is the way to go, but can't figure out how to get the data in such a dataset.
Say I have three bars:
Bar 1 has value 7, runs from x =1 to x=2
Bar 2 has value 5, runs from x=3 to x=4
Bar 3 has value 9, runs from x=5 to x=8
How can I set up a dataset to use with a vertical bar chart (the ChartFactory form)?
IntervalXYDataset
Re: IntervalXYDataset
Hi Lou,
You are not dense...it is just that there is only one class that implements the IntervalXYDataset interface at present, the TimeSeriesCollection class. This will draw bars for time series data, but that isn't what you want.
Oh, there is one other...in the src/com/jrefinery/chart/demo directory, there is a class (SimpleIntervalXYDataset.java) that provides a "quick and dirty" implementation of the IntervalXYDataset interface. Everything is hard coded...but you could take this class as a starting point if you wanted to.
Regards,
Dave Gilbert
You are not dense...it is just that there is only one class that implements the IntervalXYDataset interface at present, the TimeSeriesCollection class. This will draw bars for time series data, but that isn't what you want.
Oh, there is one other...in the src/com/jrefinery/chart/demo directory, there is a class (SimpleIntervalXYDataset.java) that provides a "quick and dirty" implementation of the IntervalXYDataset interface. Everything is hard coded...but you could take this class as a starting point if you wanted to.
Regards,
Dave Gilbert