cancel
Showing results for 
Search instead for 
Did you mean: 

Graph not plotting for micro level data

Shekhar_Sukhabhogi
Associate II

Hi Everyone,

I am trying to plot the custom graph using randomly generated float values with up to 5 or 6 digits precision. Basically, I want to plot the graph for micro level data. For ex: my random float data is 0.19XXXX and my observations are like, if my 3rd digit is >= 5 then it is showing logic HIGH on the graph and if it is <5 then it is showing as logic LOW irrespective of 4th, 5th and 6th digit data. That means, if data is 0.192789 -> Low on the graph and 0.195123 -> High on the graph. Please let me know if any additional details are required. Thanks for your support.  

5 REPLIES 5
GaetanGodart
ST Employee

Hello @Shekhar_Sukhabhogi and welcome to the community!

 

What is the issue exactly?
What is the expected result?
What is the actual result?

 

I understand that you generate some random value with decimal point, but is the goal to show the value on the graph or to just show high or low?
If the goal is to just show high or low on a graph, how are you planning on doing that? 0 for low and 1 for high?
What are you left at right now?

 

Can you share your project (possibly great if it can run on the simulator)?
Can you share screenshots of what you want and what you have?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Thanks for your reply. My goal is to plot a graph of random signal data which is in the order of micro volts and drag up/down along the Y axis. Expecting the graph of generated random signal data like pulses . For ex: my Y range is 0-100 and I can generate the random values within this range and expecting the graph pulse for each sample that I generated. If I generate 10 different random values, my graph should have 10 different peak pulses. But, in my case where I am trying for plotting micro level data (data with 6 decimal points. ex: 0.XXXXXX) is showing only 2 levels either HIGH or LOW pulses irrespective of different micro level data samples. What I observed is, the graph is plotting up to milli volts range and beyond that (micro volts range) the graph is truncating the value and not plotting it. I will try to share the image later. Thanks.

Hello @Shekhar_Sukhabhogi ,

 

I don't understand the high or low level.

The issue seems to be that you are missing some precision points, you want to be 5 or 6 digits after the coma but you are limited to 3.
Have you used the setScale function ?
Can you share you project so I can see the issue?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hi @GaetanGodart ,

Thank you for your reply. Yes, your understanding is correct. Graph is missing some precision points, I want to plot the graph even for 5 or 6 digits after the decimal point but it is limited to 3". My test data can be in different styles. Ex: 1234.5, 8.123456, 0.123456, 0.012345. If I take example data as 0.123456 then the graph is showing only 0.123 data and remaining 456 values it is showing as 0 (or no change in the graph).

I am using below functions of graph: 

1). graph.setScale(100);

2). float dataToPlot = getRandomMicroFloat(0.198523f); -> It will generate the required precision data to plot the graph (Ex: 0.198123).

3). graph.addDataPoint(dataToPlot); -> It will add data to the graph.

4). graph.setGraphRangeY(float Min, float Max); -> To adjust the Y-axis limits (Ymin, Ymax) if in case the graph cross the current Y limits.

5). graph.setGraphRangeX(start, end);

Just shared sample graph image for your reference. 

Sorry for not sharing project details since it is confidential.

Hello @Shekhar_Sukhabhogi ,

 

How do you know that only the 0.123 data is showing and the remaining 456 is not showing and considered 0?
If I had a graph that is 400 pixels high, with a range of 0 to 1 000 000, I am pretty sure that 0123456 and 0123000 would be at the same pixel height since the screen resolution is not high enough.

Why do you set scale to 100?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)