1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

feat(chart): add lv_chart_set_series_color

This commit is contained in:
Gabor Kiss-Vamosi 2021-03-16 12:29:21 +01:00
parent 3f23733961
commit 8106c2f348
2 changed files with 18 additions and 0 deletions

View File

@ -390,6 +390,16 @@ void lv_chart_hide_series(lv_obj_t * chart, lv_chart_series_t * series, bool hid
lv_chart_refresh(chart);
}
void lv_chart_set_series_color(lv_obj_t * chart, lv_chart_series_t * series, lv_color_t color)
{
LV_ASSERT_OBJ(chart, MY_CLASS);
LV_ASSERT_NULL(series);
series->color = color;
lv_chart_refresh(chart);
}
void lv_chart_set_x_start_point(lv_obj_t * obj, lv_chart_series_t * ser, uint16_t id)
{
LV_ASSERT_OBJ(obj, MY_CLASS);

View File

@ -265,6 +265,14 @@ void lv_chart_remove_series(lv_obj_t * obj, lv_chart_series_t * series);
*/
void lv_chart_hide_series(lv_obj_t * chart, lv_chart_series_t * series, bool hide);
/**
* Change the color of a series
* @param obj pointer to a chart object.
* @param series pointer to a series object
* @param color the new color of the series
*/
void lv_chart_set_series_color(lv_obj_t * chart, lv_chart_series_t * series, lv_color_t color);
/**
* Set the index of the x-axis start point in the data array.
* This point will be considers the first (left) point and the other points will be drawn after it.