Hi,
I want to create a histogram. Is there any simple way to do this, or do I have to make all the calculations by hand?
Thank you very much for beeing so helpful with my other questions.
Linh
Is it possible to create a histogram with JFreeChart
Re: Is it possible to create a histogram with JFreeChart
Hi Linh,
It's not as simple yet as it could be, but in the ChartFactory class there is a method createVerticalXYBarChart(...). This requires an IntervalXYDataset.
At the moment, the TimeSeriesCollection class is the only one that implements the IntervaXYDataset interface, and it does so with constant bar widths. This class isn't going to help you create a histogram (but does give one example implementation of the IntervalXYDataset interface).
You could write a more generic implementation that allowed for varying column widths (which is sometimes necessary for histograms if I recall correctly). Then it would be good to create some utility methods to process a set of observations into a dataset for a frequency histogram.
I'm not that familiar with all the variations of histograms, so it would be great if some people could define some additional requirements. Or a good reference...
Regards,
DG.
It's not as simple yet as it could be, but in the ChartFactory class there is a method createVerticalXYBarChart(...). This requires an IntervalXYDataset.
At the moment, the TimeSeriesCollection class is the only one that implements the IntervaXYDataset interface, and it does so with constant bar widths. This class isn't going to help you create a histogram (but does give one example implementation of the IntervalXYDataset interface).
You could write a more generic implementation that allowed for varying column widths (which is sometimes necessary for histograms if I recall correctly). Then it would be good to create some utility methods to process a set of observations into a dataset for a frequency histogram.
I'm not that familiar with all the variations of histograms, so it would be great if some people could define some additional requirements. Or a good reference...
Regards,
DG.
Re: Is it possible to create a histogram with JFreeChart
Hello,
I would also like to use JFreeChart to produce histograms.
Here are a couple of good (and simple) on line references which illustrate what is needed for a histogram.
http://quarknet.fnal.gov/toolkits/ati/histograms.html
http://www.shodor.com/interactivate/act ... index.html
I hope that JFreeChart will be able to include histogram classes in the future.
Thank you,
Ted Hill
I would also like to use JFreeChart to produce histograms.
Here are a couple of good (and simple) on line references which illustrate what is needed for a histogram.
http://quarknet.fnal.gov/toolkits/ati/histograms.html
http://www.shodor.com/interactivate/act ... index.html
I hope that JFreeChart will be able to include histogram classes in the future.
Thank you,
Ted Hill