cancel
Showing results for 
Search instead for 
Did you mean: 

multiple data line Dynamic Graph

amorftor
Associate II

Hello, I'm using a dynamic graph for a project. Can I display 2 different sets of data on this graph? Using 2 separate graphs doesn't solve my problem since I need them to be on the same graph.

5 REPLIES 5
Osman SOYKURT
ST Employee

Hello @amorftor,

Do you mean you want to use only one graph widget? or do you want to show one graph?
With touchgfx, you can easily show multiple sets of data in one graph, but you must use multiple graph widgets (as they're only matching with 1 set of data). For example, with the graph example we provide in TouchGFX, I copied the graph widget and modified it a little bit in the code to make it look like this :

OsmanSOYKURT_0-1692889993316.png

Let me know if it's what you want to realize.

Osman SOYKURT
ST Software Developer | TouchGFX

I wanted to show only 1 widget. Normally, I show the data using 2 graphs, but when I need to autoscale on the y-axis, the ratios of the 2 graphs change and I can't get proper results.

When I read the touchgfx docs, it seems like 2 data cannot be processed into 1 chart.

Hello @amorftor ,

I see. Then I would use the autoscale for only one of the 2 graphs, and the other one should use the scale defined by the first one using the getScale() and setScale() functions. For the range of your second graph, you should also use the range of your first graph using the getGraphRange() and setGraphRange() functions. In that way, you could draw only one graph with 2 sets of data that have the same scale and range.

Osman SOYKURT
ST Software Developer | TouchGFX

Do you have an example on how to do this?

demek istediğini anladım fakat nasıl yazacağımı bilemedim. İlgin için teşekkür ederim. Bilerek türkçe yazıyorum.