Skip to main content
Associate II
December 8, 2023
Solved

Clearing Dynamic Graph Data

Hello, 

I'm having issues trying to clear the data set from a dynamic graph in Touch GFX. Unfortunately none of the data points nor graph line are being cleared from the graph.

The graph is set to scroll as more data is added. When a "user session" is reset I would like to clear the existing data from the dynamic graph. 

I would think it was as simple as calling the clear() function but I am not having any luck. Documentation says invalidation is done when clear() function is called but I have also tried adding the invalidate. 

 

dynamicGraphVoltage.clear();

dynamicGraphVoltage.invalidate();

 

Thank you for any suggestions!

This topic has been closed for replies.
ST Employee
December 14, 2023

Hello @Jonathan-Halltech,
To reset the dynamic graph you just need to call the clear() function as you mentioned and you don't need to call invalidate(). 

If you're planning to clear the graph when user the user exits the screen, you should call the function before 

YourScreenBase::tearDownScreen(); 
in tearDownScreen of your screen. But still, clear() should reset your graph whenever you call it. Could you please  tell us the version of TouchGFX you are using? And does this happen in the simulator or on the board? 

Thank you 
Mohammad MORADIST Software Developer | TouchGFX

1 reply

ST Employee
December 14, 2023

Hello @Jonathan-Halltech,
To reset the dynamic graph you just need to call the clear() function as you mentioned and you don't need to call invalidate(). 

If you're planning to clear the graph when user the user exits the screen, you should call the function before 

YourScreenBase::tearDownScreen(); 
in tearDownScreen of your screen. But still, clear() should reset your graph whenever you call it. Could you please  tell us the version of TouchGFX you are using? And does this happen in the simulator or on the board? 

Thank you 
Mohammad MORADIST Software Developer | TouchGFX