This is a migrated thread and some comments may be shown as answers.

Dynamic DataSeries

5 Answers 252 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Alexy
Top achievements
Rank 1
Alexy asked on 21 May 2009, 01:22 PM
Hey,

Sometimes, when I am trying to clean the data series, the system crushes.

RadControl1.DefaultView.ChartArea.DataSeries.Clear();

I am using the Silverlight, I have a TabControl and a couple of TabItems, where each TabItem has its Chart control. For example, Linear, Spline, Bar, Range.
When I select a new tab, I try to clean the DataSeries and fill it with new data.

But sometimes I've got an error, something like 'Internal Error' on DefaultView.ChartArea.DataSeries.Clear();.
Exception of type 'System.ExecutionEngineException' was thrown.

Any ideas?

5 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 25 May 2009, 07:46 AM
Hello Alexy,

While we are aware of a similar issue with Stick and CandleStick series and the fix for it will be included in service pack 2 release, expected later today, we have not been able to reproduce it with Line, Spline, Bar or Range series. Can you provide more details or send us a small example, showing this? Thanks.

All the best,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Reuben
Top achievements
Rank 1
answered on 04 Jun 2009, 08:11 PM
Hello,

I am facing the same issue, we are only using Bar and Spline definitions:

ProgressChartArea.DataSeries.Clear();

 


foreach
(DataSeries ds in progressModel.DataSeriesCollection)

 

{

          ProgressChartArea.DataSeries.Add(ds);

}

The DataSeries.Clear() throws the exception when there is data in the .DataSeries property.  The DataSeries we're adding (as previously stated) are only BarSeries and Spline definitions.

Any updates?
Reuben

0
Ves
Telerik team
answered on 05 Jun 2009, 10:37 AM
Hello Reuben,

Can you please provide more details about your scenario. Simply adding a spline and a bar series to the chart and then clearing them does not seem to trigger this issue. You can find attached a small page, which works fine with both Q1 SP1 and Q1 SP2 versions. Feel free to open a support ticket if you need to attach an example or another file.

Regards,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Reuben
Top achievements
Rank 1
answered on 05 Jun 2009, 11:02 AM
Thank you for the quick reply.

I upgraded to the latest release (May 26th).  I was using April 13th's release.

The upgrade fixed the issue!  Although I wasn't using candlestick graph types, the bar/spline series DataSeries.Clear() now works for me.

The reason I'm doing DataSeries.Clear() though, is I couldn't figure out how to databind a DataSeriesCollection to a RadChart.  The DataSeriesCollection has dynamic graph types within it.  I tried to understand the manual series definition example in the documentation, but it doesn't appear that the ItemsSource property is liking my observablecollection (which is the DataSeriesCollection itself).

So I ended up just manually adding the data series, clearing them out, and adding updated versions - do you have an example of databinding DataSeriesCollection that have different/dynamic series definitions, to a radchart?

Thanks,
Reuben
0
Ves
Telerik team
answered on 08 Jun 2009, 07:29 AM
Hello Reuben,

RadChart is responsible for creating the DataSeriesCollection and for this reason the DataSeries property of the ChartArea is read-only. Generally, you can add/remove/modify series in this collection, but you cannot initialize it. Still, you can set the ItemsSource property with any observable collection, which contains the data you need to show. This collection does not need to be a DataSeriesCollection, but it could be a collection of custom objects. RadChart provides convenient mapping mechanism for databinding in such scenarios. You can take a look at these help topics:


You can also check this online example for more details about databinding RadChart. Even though this is an example of RadChart for WPF, the approach shown there is applicable in RadChart for Silverlight. Hope this helps.

Greetings,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Chart
Asked by
Alexy
Top achievements
Rank 1
Answers by
Ves
Telerik team
Reuben
Top achievements
Rank 1
Share this question
or