简体   繁体   中英

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.

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. You should only need validate() and repaint() if you add or remove components. You can update your chart dynamically as shown here and here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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