cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Graph with multiple lines

WBABD
Associate II

Can TouchGFX devs please create a widget that will let you plot multiple data sets on the same graph? It would be a really useful feature, I had a go at creating my own and I found it incredibly difficult to develop as it requires a significant knowledge of the internals of TouchGFX to perform.

5 REPLIES 5
ktrofimo
Senior III

Current (4.16 and 4.17) DynamicGraph ​already can do it. Simply add as many lines as you need.0693W00000DpmyDQAR.jpg

WBABD
Associate II

I am using 4.17, when I add a value it will only plot that singular value. I need different Y values on the same X point with different line styles. For example like this:

 0693W00000Dn6r1QAB.png

Exactly. Add extra lines in designer. Name them like graph2, graph3 and so on and then in your code call:

graph.AddPoint( y ); 
graph2.AddPoint( y2 ); 
graph3.AddPoint( y3 ); 

and so on...

My example has 2 graph: yellow is sinewave with some random noise and blue is slider value.​

The only limitation - graphs should have same number of points on X (horizontal) axis. Otherwise they could be unsynchronized​. In other words you should add new points to all graphs at the same time. No "holes" are allowed.

Oh okay so you have to overlay graphs at the moment and you cannot just add new Elements to store points into?