why the chart can not update?

2 posts, 0 answers
  1. Luo
    Luo avatar
    2 posts
    Member since:
    Jul 2012

    Posted 05 Oct 2012 Link to this post

    when i use the chart,and use chart.Series[0].ItemsSource = tempDrw ( here the tempDW is a double type array; to draw the line like the attachment.

    but i have a problem: when the data in the tempDrw change but the chat can not updata.

  2. Petar Marchev
    Petar Marchev avatar
    968 posts

    Posted 09 Oct 2012 Link to this post

    Hello Luo,

    From the code that you have provided (chart.Series) it seems that you are talking about the RadChartView and not the RadChart control. This is why I have changed the product of this thread. Let me know if I have made a mistake.

    Now, onto your question. The chart not getting updated is expected because double[] is not an observable collection. You will either need to reset the ItemsSource every time you need the chart to update or use an observable collection instead:

    chart.Series[0].ItemsSource = null;
    chart.Series[0].ItemsSource = tempDrw;

    observable collection:
    var oc = new ObservableCollection();
    chart.Series[0].ItemsSource = oc;

    All the best,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft R3 2016 release webinar banner
Back to Top