2023-01-10 01:04 AM
Hi!
I have a dynamic graph that I want to autoscale depending on max and min of the curve. So each time I get a new value I redraw the graph with the new Y range. I also want my graph to have two Y Axis labels: min and max. How do I achieve that? For example, if I set range to (12, 57) I want to see only those two labels: 12 and 57. So far I can only make it show 57 (if I set Label interval to 57), but not 12.
Solved! Go to Solution.
2023-01-11 01:21 AM
Hello again,
I modified this project to get closer to what you wanna do.
I think it cans provide you a nice first approach.
To explain quickly what I did :
For the code, I invite you to take a look at Screen1View.cpp, everything is in there.
This was done quickly and could be improved a lot, but I invite you to test it and to play with it. What you want to achieve is definitely doable.
Let me know if you have other questions.
/Yoann
2023-01-10 05:58 AM
Hello @MNema.1 ,
You can take a look at the project located in your X-CUBE-TOUCHGFX installation path (should be something like "C:\Users\username\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-TOUCHGFX\4.21.0\Projects\STM32F746G-DISCO\Applications\DynamicGraph").
I think that this project does exactly what you want.
/Yoann
2023-01-10 06:39 AM
Thank you for the answer. unfortunately, I have 4.20.0. So I can't see that example. And the only example I can find is this one (for Simulator). Is it the same?
They adjust labels there but the problem is, I need to have only 2 labels: min and max. I need something like this:
But it feels impossible to do if my min is not 0.
2023-01-11 01:21 AM
Hello again,
I modified this project to get closer to what you wanna do.
I think it cans provide you a nice first approach.
To explain quickly what I did :
For the code, I invite you to take a look at Screen1View.cpp, everything is in there.
This was done quickly and could be improved a lot, but I invite you to test it and to play with it. What you want to achieve is definitely doable.
Let me know if you have other questions.
/Yoann
2023-01-11 03:07 AM
Thank you, it helped!