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

Can I Rebind Chart with asynchronous way?

1 Answer 116 Views
Chart
This is a migrated thread and some comments may be shown as answers.
yiwei
Top achievements
Rank 1
yiwei asked on 27 Aug 2011, 04:21 AM
Hi,

I have a method that use asynchronous way.

I want to update the PaletteBrushes when some data has already been prepared.

But the PaletteBrushes doesn't updated after i invoke the  asynchronous method.

Is there any way to meet my requirement?

Thanks

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 31 Aug 2011, 09:13 AM
Hello Yiwei,

You can rebind the chart to handle this scenario. This may look something like this:

public CurrentIssue()
      {
          InitializeComponent();
 
          RadChart.ItemsSource = new int[] {123, 4, 5, 6, 7, 78};
 
          DispatcherTimer timer = new DispatcherTimer();
          timer.Interval = new TimeSpan(0, 0, 3);
          timer.Start();
          timer.Tick += new EventHandler(timer_Tick);
      }
 
      void timer_Tick(object sender, EventArgs e)
      {
          RadChart.PaletteBrushes.Clear();
          RadChart.PaletteBrushes.Add(new SolidColorBrush(Colors.Red));
          RadChart.Rebind();
          (sender as DispatcherTimer).Stop();
      }

I hope this information helps.

Best wishes,
Yavor
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Chart
Asked by
yiwei
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or