Hi everyone, I would like to add a unit to the y-axis. Is it possible?
What MCU/Processor/Board and compiler are you using?
ESP32
What LVGL version are you using?
8.3.4
What do you want to achieve?
I want to label the y-axis with different units. Like the x-axis in the picture.
What have you tried so far?
The x-axis I have already managed to label with an event_cb, as in the chart example. I tried the same way as in the chart example, but it didn’t work.
What puzzles me, how did you manage to label the x-axis, as I don’t see the code for it.
Your code for labeling the y-axis is wrong.
If you have the tick values of 0, 20, 40… that means the dsc->value is 0, 20, 40…
That means you want to print voltage[0], voltage[20], voltage[40] …
Which is of course wrong, as you only have voltage[0…5].
As you just want to add a V to the ticks value, just do the following: