Here´s what i want to do: I have in my DB a certain entity, let´s call it “people” and another one, let´s call it “room”. The amount of people in the room can change every 15 minutes,i.e full hour, quarter after, etc.
Now, i want to create a timechart with jfreechart that shows the amount of people in the room for a period of 3 years, zoomable to the quarter hour (or minute, for all i care :))
Question 1: the dataset. Can i use the JDBCXYDataset to do it or is it better to execute the query and write the data from the resultset to a TimeseriesCollection (code example??)
Question2: i want the chart to initialize showing the whole 3 years and beeing able to zoom in to the individual days/hours/minutes. How do i set this up ?
Thanks for helping.
Your best bet is going to just run a query and create a
TimePeriodValuesCollection.JDBCXYDatasetis just anXYDataset.For your second question, you just need to have your Time Period Series populated with three years of data. If you do that the chart is going to show the whole three years by default. Then you can zoom.
When creating the data, use a
TimePeriodValuespopulated with SimpleTimePeriod ‘s objects.