zapta
January 9, 2021, 10:11pm
1
Description
I created a columns chart with a single series and it works, except that the spacing between the bars is way too wide. Is there a way to increase the bars’ width and reduce the spacing width?
What MCU/Processor/Board and compiler are you using?
stm32f401
What LVGL version are you using?
LVGL_VERSION_MAJOR 7
LVGL_VERSION_MINOR 5
LVGL_VERSION_PATCH 0
LVGL_VERSION_INFO “dev”
What do you want to achieve?
Wider bars and less space between them.
What have you tried so far?
Searched the documentation, API, and the forums here.
Code to reproduce
It’s a general questions about the capabilities of the LVGL COLUMNS chart, not specific for any code.
Screenshot and/or video
Note that there is 2 type of spacing here:
the space you see here, (between x == 0 and x == 1). At this moment this is hardcoded to “1 column width space”
the space between columns on the same x coordinate (if you have multiple series)
Change this line to:
lv_coord_t col_w = w / ((_lv_ll_get_len(&ext->series_ll) + 0) * ext->point_cnt);
This way only the 2) type of spacing will be visible and it can be adjusted with pad_inner
on the series part.
zapta
January 13, 2021, 4:09am
3
Thanks kisvegabor. The chart in my picture has only a single series. Any chance extending the LVGL API to allow control of the inter bar spacing?
I plan to let platformio to manage the LVGL library so prefer not to fork it.