cancel
Showing results for 
Search instead for 
Did you mean: 

plotting a customized data graph with x and y axis on STM32U5A9J-DK

emmaulala
Associate II

I use STM32U5A9J-DK to plot a graph containing a series of V-I data. I have tried static graph widget and was succeed, but it somewhere doesn't meet my need: the label can only show int, if  x data range is -0.6~0.6V, I can only scale them to -600~600, in mV unit, (but I want to show unit in V); besides, my data sequences may have the same x value with different y, e.g. (-0.6,2) (-0.2,5) (0,3) (-0.2,2) (-0.6,1), data like this can't be plotted on static graph, it only accepts monotonous x value. 

I need my graph showing the original data points (need no scaling) and allowing same x value with different y values, Any other way I can build a graph fitting my requirement? I use touchgfx 4.26.1, seems no canvas function ?!

I mean like drawing the plot below, with a lots of on the same graph, and allow me to active/inactive the plot, each plot is a regression

emmaulala_0-1777545112885.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
JohanAstrup
ST Employee

OK, clear.

You are right - there is no built-in TouchGFX feature that allows you to do that.

My recommendation would be to create a custom widget using the VectorRenderer class. For simplicity, you could still use the graph widget to display the axes.

Best regards,
Johan

View solution in original post

3 REPLIES 3
JohanAstrup
ST Employee

Hello @emmaulala.

I am not sure I fully understand all the details of your request, but in general, I would recommend taking a look at the Graph screen in the HVAC Demo, which is available in TouchGFX Designer:
JohanAstrup_0-1778144849270.pngJohanAstrup_1-1778145074699.png

Here, three graphs are shown concurrently, with one of them highlighted. The labels are created using text areas to make them more flexible and versatile.

Please let me know if there are any specific features you still cannot get to work after reviewing the demo.

Best regards,
Johan

hi @JohanAstrup 

thanks, but what I need is to draw a regression data plot, like this, it increases, then decreases in X axis, seems static graph can't meet this requirement, because it only allows monotonous X axis, right?! I tried addDataPoint(), and it only plot the later data points if the x is repeat, e.g.these data (-0.6,2) (-0.2,5) (0,3) (-0.2,2) (-0.6,1),  on the graph will not plot (-0.6,2) , because it's replaced by (-0.2,2) automatically, seems I can only create a customized graph element to draw this data plot ....?

emmaulala_0-1778212033701.png

 

JohanAstrup
ST Employee

OK, clear.

You are right - there is no built-in TouchGFX feature that allows you to do that.

My recommendation would be to create a custom widget using the VectorRenderer class. For simplicity, you could still use the graph widget to display the axes.

Best regards,
Johan