在 JFreeChart TimeSeries 图表上标记点
我有一个包含 2 个数据项的 JFreeChart TimeSeries 图表。
我需要在其中标记点。
例如,我需要它在特定时间显示该线的值是什么(虽然实际上没有任何值并且 JFreeChart 创建了线)。
示例:
TimeSeries t=new TimeSeries("Test",Second.class);
Dataset.addSeries(t);
Calendar C=Calendar.getInstance();
t.add(new Second(C.getTime()), 100);
C.setTimeInMillis(C.setTimeInMillis+10*60*60*1000);
t.add(new Second(C.getTime()),200);
// Now I want Something like this psudo code
C.setTimeInMillis(C.setTimeInMillis-5*60*60*1000);
t.mark(new Second(C.getTime()));
如何通过域值标记系列上的点(因此应自动计算范围值)?
谢谢
I have a JFreeChart TimeSeries chart that has 2 data item.
I need to mark points in it.
For example I need it show at a specific time what is the line's value (while there is not actually any value and JFreeChart created line).
Example:
TimeSeries t=new TimeSeries("Test",Second.class);
Dataset.addSeries(t);
Calendar C=Calendar.getInstance();
t.add(new Second(C.getTime()), 100);
C.setTimeInMillis(C.setTimeInMillis+10*60*60*1000);
t.add(new Second(C.getTime()),200);
// Now I want Something like this psudo code
C.setTimeInMillis(C.setTimeInMillis-5*60*60*1000);
t.mark(new Second(C.getTime()));
How Can I mark points on a series by their domain value (So the range value should be calculated automatically)?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显示插值的一种便捷方法是启用轴跟踪功能,如本示例所示。
附录:另一种方法是将插值值添加到数据集中并抑制其显示
形状
,如此处所示。然后,(未标记的)值将可用于工具提示生成器、标签生成器、图表鼠标侦听器等。One convenient way to show interpolated values is to enable the axis trace feature, as shown in this example.
Addendum: An alternative is to add the interpolated values to the data set and suppress the display of their
Shape
, as shown here. The (unmarked) value will then be available to a tool tip generator, label generator, chart mouse listener, etc.