2026-04-30 1:49 AM - edited 2026-04-30 3:33 AM
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
Solved! Go to Solution.
2026-05-13 2:21 AM
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
2026-05-07 2:17 AM
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:
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
2026-05-07 8:53 PM
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 ....?
2026-05-13 2:21 AM
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