Sync multiple charts together
Posted: Thu Jul 27, 2017 1:53 am
Hi ,
I've created a Custom Control that contains a LightingChart Graph. This control contains a method named RefreshUI() that refresh the Graph taking the information from a Object.
In the MainApp I add 4 of these Custom Controls to a Grid. This means that I end up having 4 LightingChart Graphs.
The thread that belongs to the main app is the one that makes the Data Calculations, and each x amount of time calls each custom control's RefreshIUI() method.
The problem is that you can see the delay between each renderization. First you see the change in the userControl1, then 2, then 3... etc.
I tried using C# parallelization but didn't worked, as that only parallelizes the calls to each of those methods.
I also try this, but same output
Is there an out of the box feature in LightingChart to Manage this differents Charts as a group?
What's my best option?
I want all of them to refresh toghether.
Thanks in advance,
Andrés
I've created a Custom Control that contains a LightingChart Graph. This control contains a method named RefreshUI() that refresh the Graph taking the information from a Object.
In the MainApp I add 4 of these Custom Controls to a Grid. This means that I end up having 4 LightingChart Graphs.
The thread that belongs to the main app is the one that makes the Data Calculations, and each x amount of time calls each custom control's RefreshIUI() method.
Code: Select all
userControl1.RefreshUI(ref prof);
userControl12.RefreshUI(ref prof);
userControl13.RefreshUI(ref prof);
userControl14.RefreshUI(ref prof);
The problem is that you can see the delay between each renderization. First you see the change in the userControl1, then 2, then 3... etc.
I tried using C# parallelization but didn't worked, as that only parallelizes the calls to each of those methods.
I also try this, but same output
Code: Select all
Task taskA = Task.Factory.StartNew(() => userControl1.RefreshUI(ref prof));
Task taskB = Task.Factory.StartNew(() => userControl2.RefreshUI(ref prof));
Task taskC = Task.Factory.StartNew(() => userControl3.RefreshUI(ref prof));
Task taskD = Task.Factory.StartNew(() => userControl4.RefreshUI(ref prof));
Task.WaitAll(new[] { taskA, taskB, taskC, taskD });
What's my best option?
I want all of them to refresh toghether.
Thanks in advance,
Andrés