Please point me in correct direction. Need help. Requirement to show below dynamic data ( need to refresh the charts every 10 s开发者_开发技巧ecs).
- # of items in a queue
- Age of oldest item in Queue.
I am using Jfreechart, confused about what kind of chart is appropriate for this kind of requirement. Would like few pointers.How about showing both 1 and 2 in the same chart? or else should I show 1 and 2 in separate charts?
Consider org.jfree.data.time.DynamicTimeSeriesCollection
, which "adds the ability to append new data and discard the oldest." A javax.swing.Timer
is convenient for the periodic updates, as it's action event handler executes on the event-dispatching thread.
Addendum: As it's a time series, the domain axis can be formatted to show the age. An XYItemLabelGenerator
is an alternative; here is an example using NumberFormat
. The number of items in the queue can be displayed in the corresponding series' legend.
How about showing both 1 and 2 in the same chart? or else should I show 1 and 2 in separate charts?
The answer is: What does your customer want to see?
Is it meaningful to be able to immediately correlate these two data points?
精彩评论