cancel
Showing results for 
Search instead for 
Did you mean: 

Graph data not showing

Thomas8607
Senior

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.

26 REPLIES 26

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? 

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:

JTP1_0-1717845201692.png

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


@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 👍

Ok, i started with the dynamic, but didn't work.

I will change to dynamic

Yes, the dynamicgraph is working.
How can i reset the graph? Enough dynamicGraph1.clear(); ?

Very good.

Yes, dynamicGraph1.clear(); does the job 👍

Nice looking UI have (in youtube video).

Br JTP

The issue was that i placed into radiobutton x selected functions the clear command.

Only one problem was with it 😀

The functions call continous 😀

 

Thank you your help! 

JTP1
Lead

You're welcome !

Where it was call then...some code that we didin't see ?

 

In the second reply, the cpp code. 

JTP1
Lead

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.