Sync multiple charts together

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
Andres
Posts: 8
Joined: Mon May 22, 2017 9:40 pm

Sync multiple charts together

Post by Andres » 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.

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 });
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

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Sync multiple charts together

Post by ArctionPasi » Thu Jul 27, 2017 5:40 am

Hi Andres,

If they are XY charts, I recommend creating a graph segment for each chart. So you end up with 1 LightningChart, which has 4 segments stacked. If they need to be side-by-side, or other chart types than XY, each chart must be created separately.
LightningChart Support Team, PT

Post Reply