Dynamic DataSeries

6 posts, 0 answers
  1. Alexy
    Alexy avatar
    11 posts
    Member since:
    May 2009

    Posted 21 May 2009 Link to this post

    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?
  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 25 May 2009 Link to this post

    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.
  3. DevCraft banner
  4. Reuben
    Reuben avatar
    17 posts
    Member since:
    Apr 2009

    Posted 04 Jun 2009 Link to this post

    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

  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 05 Jun 2009 Link to this post

    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.
  6. Reuben
    Reuben avatar
    17 posts
    Member since:
    Apr 2009

    Posted 05 Jun 2009 Link to this post

    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
  7. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 08 Jun 2009 Link to this post

    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.
Back to Top
DevCraft banner