cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX Graph widget with addDataPoint(x, y)?

George Journeaux
Associate II

Hi

The new dynamic graph widget is great, but is there a setting / different graph widget that will allow me to plot data based on a set of coordinate points (x and y)?

For example, with the dynamic graph widget there is an addDataPoint(y) method. Is there a similar method for plotting data that doesn't have fixed x coordinate intervals?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Alexandre RENOUX
Principal

Hello @GMeur​ ,

You are absolutely right. This feature matches more a "static graph". And indeed we plan on releasing such a widget in the future.

George and GMeur, thank you for your input. Unfortunately, I cannot give any release date since I don't know it myself but we will keep you updated on that.

/Alexandre

View solution in original post

6 REPLIES 6
Romain DIELEMAN
ST Employee

Hi,

I am not sure I understand exactly what you are looking for and where to guide you, but this seems interesting. What are you trying to do exactly ?

/Romain

George Journeaux
Associate II

Hi Romain

The dynamic graph widget allows me to add data points to the graph with a value of "Y" at fixed intervals of "X".

For example, with the graph below I provide the Y values which are then plotted at fixed intervals of X (in this example the fixed intervals of X are 1)

0693W000008GaAQQA0.pngThis works well for things like live sensor readings that are updated at regular intervals.

What I would like to do is plot a graph using a data set with X and Y values - like (X, Y) coordinates - where the X values are not just regular intervals.

For example, with the graph below I provide a set of X values and Y values which are then plotted as (X, Y) coordinates on the graph. As you can see the X values are not at fixed intervals, so the X value needs to be provided with the corresponding Y value to plot it in the correct place on the graph.

0693W000008GaLTQA0.pngI hope that clears us the question.

Thanks

GMeur
Senior

Hej,

I'm looking exactly for the same thing! I think that basically, what we're looking for is a 'static graph' where one can specify the points they want to add.

It's a pitty that there's no such widget for the moment from what I've seen… Well, to be more exact, there is one (from version 10 if I'm not mistaken) but it's not an 'official' one that can be configured through the studio and many functionalities of the dynamic widget are missing… Plus it uses different objects to do the same thing (draw the line, fill the area below,…) so it would be a bit of a drag to use both the dynamic and static graphs in the same project… Do you plan to release such a widget in the future?

Thanks.

Alexandre RENOUX
Principal

Hello @GMeur​ ,

You are absolutely right. This feature matches more a "static graph". And indeed we plan on releasing such a widget in the future.

George and GMeur, thank you for your input. Unfortunately, I cannot give any release date since I don't know it myself but we will keep you updated on that.

/Alexandre

Hi,

It is not in our current sprint but since it is not the first time this is asked I will bring it up again to the team. Could you add this to the Idea Zone of this forum as well ? (and also go through it to upvote ideas you think you would like to see as well )

/Romain

Emilmart
Senior

Hi,

Each second, I update my graph with 50 new points. (my number of data point is set to 50)

I'm not looking exactly to set the x-coordinates for each y-coordinates, but I'd like to keep the x-range always at my defined range in TouchGFX desginer, even when I add an y-data points with addDataPoint(y) method when the range of x-axis is at max value.

Let's says that my x-axis range is [0; 100], When I add points each ticks, the x range increments and isn't displaying the initial [0;100] range, but [522; 622] for example (incrementing each tick when I add my 50 points).

Any methods to have a fixed displaying x-range ?

I try to clear my graph with the graph.clear() method, but it doesn't reset the x-axis

thanks !