开发者

Jfreechart dynamic charts

Please point me in correct direction. Need help. Requirement to show below dynamic data ( need to refresh the charts every 10 s开发者_开发技巧ecs).

  1. # of items in a queue
  2. 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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜