2025-01-30 02:41 AM
Hi,
I am trying to plot an array of 512 values in a dynamic graph in touchgfx. This is working as intended but I am experiencing poor performance. When in histogram mode the graph updates quickly however I wish to use line mode and when in this mode, the graph will take between two and three seconds to update. I'm aiming to get the graph to update in around one second.
Any ideas on how to optimise the plotting of the graph. Perhaps the way in which the data is passed from Model.cpp into the screenView.cpp?
Currently I am passing the data through as such:
for(int i = 0; i < 512; i++)
{
modelListener->UpdateGraph(i, graphData[i]);
}
Any help would be greatly appreciated.
Thanks.
2025-01-30 02:48 AM
@Josh_W020 wrote:Any ideas on how to optimise the plotting of the graph. .
Do you really need to plot all the values?
eg, could you just plot every fourth? Maybe averaged?
2025-01-30 04:07 AM
Hello @Josh_W020 ,
Could you try to increase your canvas buffer and see if it's better?
2025-01-30 07:05 AM
Tried doubling this from 12000 to 24000 but didn't see any difference.
2025-01-30 07:06 AM
Yes unfortunately its important that all values are plotted as it needs to be a high accuracy representation of a recorded frequency.