@@ -5220,6 +5220,7 @@ struct nk_style_chart {
52205220 struct nk_vec2 padding;
52215221 float color_factor;
52225222 float disabled_factor;
5223+ nk_bool show_markers;
52235224};
52245225
52255226struct nk_style_combo {
@@ -5410,6 +5411,7 @@ struct nk_chart_slot {
54105411 int count;
54115412 struct nk_vec2 last;
54125413 int index;
5414+ nk_bool show_markers;
54135415};
54145416
54155417struct nk_chart {
@@ -18678,6 +18680,7 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table)
1867818680 chart->rounding = 0;
1867918681 chart->color_factor = 1.0f;
1868018682 chart->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
18683+ chart->show_markers = nk_true;
1868118684
1868218685 /* combo */
1868318686 combo = &style->combo;
@@ -28629,7 +28632,8 @@ nk_chart_begin_colored(struct nk_context *ctx, enum nk_chart_type type,
2862928632 slot->highlight = highlight;
2863028633 slot->min = NK_MIN(min_value, max_value);
2863128634 slot->max = NK_MAX(min_value, max_value);
28632- slot->range = slot->max - slot->min;}
28635+ slot->range = slot->max - slot->min;
28636+ slot->show_markers = style->show_markers;}
2863328637
2863428638 /* draw chart background */
2863528639 background = &style->background;
@@ -28681,7 +28685,8 @@ nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type type,
2868128685 slot->highlight = highlight;
2868228686 slot->min = NK_MIN(min_value, max_value);
2868328687 slot->max = NK_MAX(min_value, max_value);
28684- slot->range = slot->max - slot->min;}
28688+ slot->range = slot->max - slot->min;
28689+ slot->show_markers = style->show_markers;}
2868528690}
2868628691NK_API void
2868728692nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type type,
@@ -28728,7 +28733,9 @@ nk_chart_push_line(struct nk_context *ctx, struct nk_window *win,
2872828733 i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
2872928734 color = g->slots[slot].highlight;
2873028735 }
28731- nk_fill_rect(out, bounds, 0, color);
28736+ if (g->slots[slot].show_markers) {
28737+ nk_fill_rect(out, bounds, 0, color);
28738+ }
2873228739 g->slots[slot].index += 1;
2873328740 return ret;
2873428741 }
@@ -28752,7 +28759,9 @@ nk_chart_push_line(struct nk_context *ctx, struct nk_window *win,
2875228759 color = g->slots[slot].highlight;
2875328760 }
2875428761 }
28755- nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color);
28762+ if (g->slots[slot].show_markers) {
28763+ nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color);
28764+ }
2875628765
2875728766 /* save current data point position */
2875828767 g->slots[slot].last.x = cur.x;
0 commit comments