I would like to know how to refresh a chart if we want to change \"in live\" some piece of data. I mean for instance, I have a chart with a TaskSeries which appears on 3 yea
I had this issue; I did it using this:
private void refreshChart() {
jPanel_GraphicsTop.removeAll();
jPanel_GraphicsTop.revalidate(); // This removes the old chart
aChart = createChart();
aChart.removeLegend();
ChartPanel chartPanel = new ChartPanel(aChart);
jPanel_GraphicsTop.setLayout(new BorderLayout());
jPanel_GraphicsTop.add(chartPanel);
jPanel_GraphicsTop.repaint(); // This method makes the new chart appear
}