简体   繁体   English

如何用新的Y范围显示JFree图表以进行更新?

[英]How can I get my JFree chart to update once its displayed with new Y ranges?

Here is a snipit of how I display my graph, and attempt to re render with the new Y ranges. 这是我如何显示图形并尝试使用新的Y范围重新渲染的方法。

fpe2.FPE_ExportData(outPutFilePath, xmlOutDescriptorPath);

g = new GraphUtil();
g.collectData(fpe2.subTaskType, "FPE", MaxY, MinY, PlotGraphPanel);
g.graphMake();

PlotGraphPanel.add(g.cPanel1, BorderLayout.CENTER);
PlotGraphPanel.validate();
PlotGraphPanel.repaint();

Absent your sscce , it's not clear how your program fails. 缺少sscce ,尚不清楚程序如何失败。 You should only need validate() and repaint() if you add or remove components. 如果添加或删除组件,则只需要validate()repaint() You can update your chart dynamically as shown here and here . 您可以如此此处所示动态更新图表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM