Wednesday, May 27, 2009

JFreeChart and Time-based Bar Charts

Ok... I do not get many comments on my posts (because they are short and boring) but am really looking for people to comment on this one because I am looking for feedback.

I have used CeWolf/JFreeChart for about two years now (off and on). If someone asked me to rank my knowledge of them (1 to 10) I would answer 5 - not an expert, not a novice. Recently, it has become common for my users to want time-based charts. It seems that JFreeChart does not provide much utility for building bar charts based on time series. Am I seeing this correctly? or am I failing to understand a fundamental concept of JFreeChart? (or... other?)

Any feedback?


david.gilbert said...

Yes, JFreeChart supports this. One way to do it is to create a dataset using the TimeSeries and TimeSeriesCollection classes, then call the createXYBarChart() method in the ChartFactory class. See XYBarChartDemo1 in the JFreeChart demo collection for an example.

Richard L Wellman said...

Um, I'm really embarrassed and will update my blog soon but did not realize the JFreeChart God would reply in person. ;-)

He is completely correct; In my haste, I came nowhere near asking what I truly wanted to know.
hint: stackedbarcharts