开发者

Jfreechart dynamic charts

开发者 https://www.devze.com 2023-01-27 17:56 出处:网络
Please point me in correct direction. Need help. Requirement to show below dynamic data ( need to refresh the charts every 10 s开发者_开发技巧ecs).

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

精彩评论

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