cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing Dynamic Graph Data

Jonathan-Halltech
Associate II

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!

1 ACCEPTED SOLUTION

Accepted Solutions

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 MORADI
ST Software Developer | TouchGFX

View solution in original post

1 REPLY 1

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 MORADI
ST Software Developer | TouchGFX