Starting with blank JPanelChart, refresh

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Nico

Starting with blank JPanelChart, refresh

Post by Nico » Tue Feb 12, 2002 6:02 pm

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

David Gilbert

Re: Starting with blank JPanelChart, refresh

Post by David Gilbert » Wed Feb 13, 2002 9:35 am

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.

Nico

Re: Starting with blank JPanelChart, refresh

Post by Nico » Wed Feb 13, 2002 7:06 pm

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 ?

David Gilbert

Re: Starting with blank JPanelChart, refresh

Post by David Gilbert » Thu Feb 14, 2002 7:38 am

In theory, no. In practice, I've never tried it. If it doesn't automatically update the panel, then it is a bug.

DG

Nico

Re: Starting with blank JPanelChart, refresh

Post by Nico » Thu Feb 14, 2002 10:54 am

I tried it, and it works, so there is no bug :-)
Thanks,
Nico

Locked