Skip to main content
WBABD
Associate
September 14, 2021
Question

Dynamic Graph with multiple lines

  • September 14, 2021
  • 5 replies
  • 1543 views

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.

This topic has been closed for replies.

5 replies

ktrofimo
Senior III
September 14, 2021

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

WBABD
WBABDAuthor
Associate
September 14, 2021

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

ktrofimo
Senior III
September 14, 2021

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.​