cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Graph Changing Gridlines

EthanMankins
Senior

I am having trouble finding how to change the interval of the major gridlines dynamically. I am using the scrolling graph and have implemented dynamic Y-axis range, but I want to be able to change the intervals of the gridlines as well. Is this possible using touchGFX tools or do I need to make a custom widget?

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you. 
I discovered that the labels and grids are not manipulated through the graph object, but look like they are their own separate objects.

I was originally trying to find something like graph.setYinterval();


My solution was to use graphMajorYAxisGrid.setInterval();

Eventually added graphMajorYAxisLabel.setInterval(); To make labels match

 

View solution in original post

2 REPLIES 2
JTP1
Lead

Hello Ethan

Have you simply try to use setInterval- function for to grid you need to manipulate dynamically ?

https://support.touchgfx.com/docs/development/ui-development/ui-components/miscellaneous/dynamic-graph

If you look your generated xxxxBase.cpp code, you will see how interval is set initially (and also other dynamic graph parameters, like setGraphRangeY which is also closely involved to your issue).

Hope this help

Br JTP

 

ps. this might also intrest you

https://community.st.com/t5/stm32-mcus-touchgfx-and-gui/how-to-edit-dynamic-graph-in-touchgfx-to-print-time-in-x-axis/m-p/637258

Thank you. 
I discovered that the labels and grids are not manipulated through the graph object, but look like they are their own separate objects.

I was originally trying to find something like graph.setYinterval();


My solution was to use graphMajorYAxisGrid.setInterval();

Eventually added graphMajorYAxisLabel.setInterval(); To make labels match