Hi,
I'm a new user of JFreeChart, and I would like to know if it is possible to start my app with a blank bar chart (null dataset), and then how can I refresh this chart with a new dataset when I will push a button.
I watched a bit the sources and it seems that I can't start with "null" chart in the JFreeChartPanel constructor.
Thanks in advance,
Nico
Starting with blank JPanelChart, refresh
Re: Starting with blank JPanelChart, refresh
Hi Nico,
You can create a chart with a null dataset, but it is not possible to create a JFreeChartPanel with a null chart. I'll see if I can change the code for the next version so that you can have a null chart.
Any time you want to change the chart's dataset you should be able to call myChart.setDataset(myDataset).
Regards,
DG.
You can create a chart with a null dataset, but it is not possible to create a JFreeChartPanel with a null chart. I'll see if I can change the code for the next version so that you can have a null chart.
Any time you want to change the chart's dataset you should be able to call myChart.setDataset(myDataset).
Regards,
DG.
Re: Starting with blank JPanelChart, refresh
Hi David,
Ok, fine, thanks you.
But when I call a myChart.setDataset(myDataset), do I need to make a myJFreeChartPanel.setChart(myChart) to refresh the data ?
Ok, fine, thanks you.
But when I call a myChart.setDataset(myDataset), do I need to make a myJFreeChartPanel.setChart(myChart) to refresh the data ?
Re: Starting with blank JPanelChart, refresh
In theory, no. In practice, I've never tried it. If it doesn't automatically update the panel, then it is a bug.
DG
DG
Re: Starting with blank JPanelChart, refresh
I tried it, and it works, so there is no bug 
Thanks,
Nico

Thanks,
Nico