2024-06-07 12:26 AM
Hello.
I would use a static graph to display data. In the handletickevent function, I update the addDataPoint(x data, y data) function for the given page, but nothing appears on the graph, the scale is fine, but no line or change in the x direction can be seen on the display. I am currently using the tickcounter++ variable value for X data, which also increases in debug. For X data, I entered 0min, 200max data in the touchgfx program. I also tried the dynamic graph.
Thanks if anyone can help.
Solved! Go to Solution.
2024-06-08 04:08 AM
But the x coordinates shouldn't move for the actual x values?
If the tickcounter is 500,then the x coordinate is also 500 values?
2024-06-08 04:19 AM - edited 2024-06-08 04:20 AM
Good, Please note that just clearing the static graph doesnt reset the horizontal plotting. You must also reset X coordinate value and start increasing it again from 0 to 200 (if your X range is 0-200).
If you need constantly scrolling curve, then dynamic graph is right choice. Select scroll as dynamic behavior:
then just simply add points like
dynamicGraph1.addDataPoint(some_value);
and graph-widget will place it to first free position (and also scrolls the curve if it is full).
So with dynamic graph you dont have to worry about X values. Naturally using dynamicGraph requires that the x interval of the data points is constant, otherwise the graph will be distorted in the direction of the X-axis.
Br JTP
2024-06-08 04:25 AM
@Thomas8607 wrote:But the x coordinates shouldn't move for the actual x values?
If the tickcounter is 500,then the x coordinate is also 500 values?
No, Static graph is static, it will not change X range automatically. Dynamic graph is what you need :thumbs_up:
2024-06-08 04:32 AM
Ok, i started with the dynamic, but didn't work.
I will change to dynamic
2024-06-08 08:29 AM
Yes, the dynamicgraph is working.
How can i reset the graph? Enough dynamicGraph1.clear(); ?
2024-06-08 09:10 AM
Very good.
Yes, dynamicGraph1.clear(); does the job :thumbs_up:
Nice looking UI have (in youtube video).
Br JTP
2024-06-08 09:27 AM
The issue was that i placed into radiobutton x selected functions the clear command.
Only one problem was with it :grinning_face:
The functions call continous :grinning_face:
Thank you your help!
2024-06-08 09:36 AM
You're welcome !
Where it was call then...some code that we didin't see ?
2024-06-08 09:38 AM
In the second reply, the cpp code.
2024-06-08 09:53 AM
Yes, I see that for example 'radioButton1Selected'- function clears the graph.. but hows calling it ?
I suppose if you set an interaction to virtual function (radioButton1Selected in this case), it is called only once, when button gets selected.