We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

bound ChartSeries not updating

I have a ChartSeries bound to the Rows collection of a DataTable. Rows are being added to the DataTable in real time. The new data does not get added to the ChartSeries. The Syncfusion documentation led me to believe that it would get added. The ChartSeries gets the data in the table at the time of binding. After that, new data added to the table does not get added to the ChartSeries. I need the new data to get added to the ChartSeries. How can I do this?

Bill

3 Replies

PI Poorani Idhaya Bala M.A Syncfusion Team September 17, 2009 01:08 PM UTC

Hi ,

Currently we do not have this support to add data dynamically using data table. This has been confirmed as a Feature Request. We will implement this feature in our forthcoming new version releases or service pack releases.

As a work around you can achieve this.

CollectionViewSource source = new CollectionViewSource();
DataTable table = new DataTable();

source.Source = table.DefaultView;

ChartSeries series1 = new ChartSeries();
series1.DataSource = source.View;

Please find the attached sample for more information.

Let us know if you have any questions.

Thanks for choosing Syncfusion Products.

Thanks,
Poorani



ChartWithDataTable_8d550ad6.zip


BS Bill Swartz September 17, 2009 04:39 PM UTC

Poorani,

Thanks for the sample. In the testing I have done so far, it appears to do what we need it to do. I did make some changes. First, to the constructor I added

series1.IsIndexed = false;

We need to plot xy data. The significance of the IsIndexed property is not made clear in the Syncfusion documentation. After adding the above line, I was able to comment out these 2 lines in the button click event handler.

//chart1.Areas[0].Series[0].BindingPathX = "ID";
//chart1.Areas[0].Series[0].BindingPathsY = new string[] { "Price" };

As far as I am concerned, your sample demonstrates "support to add data dynamically using data table". If further testing shows problems, I will let you know.

Bill


PI Poorani Idhaya Bala M.A Syncfusion Team September 18, 2009 06:02 AM UTC

Hi Bill,

Sorry for the inconvenience caused. We will update the documentation as soon as possible.

When a chart series is set to be indexed, the x values are treated as categories rather than values. All the points are simply plotted at an equal x distance, irrespective of the actual x value of the points. When a chart series is not set to be indexed,the x values are treated as values.

For more information please refer the "Indexed Chart Demo" sample under "Chart Series" in our sample browser.

Thanks for choosing Syncfusion products.

Let me know if you have any questions.

Thanks,
Poorani

Loader.
Live Chat Icon For mobile
Up arrow icon