|
@@ -5220,6 +5220,7 @@ struct nk_style_chart {
|
|
|
struct nk_vec2 padding;
|
|
|
float color_factor;
|
|
|
float disabled_factor;
|
|
|
+ nk_bool show_markers;
|
|
|
};
|
|
|
|
|
|
struct nk_style_combo {
|
|
@@ -5410,6 +5411,7 @@ struct nk_chart_slot {
|
|
|
int count;
|
|
|
struct nk_vec2 last;
|
|
|
int index;
|
|
|
+ nk_bool show_markers;
|
|
|
};
|
|
|
|
|
|
struct nk_chart {
|
|
@@ -18678,6 +18680,7 @@ nk_style_from_table(struct nk_context *ctx, const struct nk_color *table)
|
|
|
chart->rounding = 0;
|
|
|
chart->color_factor = 1.0f;
|
|
|
chart->disabled_factor = NK_WIDGET_DISABLED_FACTOR;
|
|
|
+ chart->show_markers = nk_true;
|
|
|
|
|
|
/* combo */
|
|
|
combo = &style->combo;
|
|
@@ -28629,7 +28632,8 @@ nk_chart_begin_colored(struct nk_context *ctx, enum nk_chart_type type,
|
|
|
slot->highlight = highlight;
|
|
|
slot->min = NK_MIN(min_value, max_value);
|
|
|
slot->max = NK_MAX(min_value, max_value);
|
|
|
- slot->range = slot->max - slot->min;}
|
|
|
+ slot->range = slot->max - slot->min;
|
|
|
+ slot->show_markers = style->show_markers;}
|
|
|
|
|
|
/* draw chart background */
|
|
|
background = &style->background;
|
|
@@ -28681,7 +28685,8 @@ nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type type,
|
|
|
slot->highlight = highlight;
|
|
|
slot->min = NK_MIN(min_value, max_value);
|
|
|
slot->max = NK_MAX(min_value, max_value);
|
|
|
- slot->range = slot->max - slot->min;}
|
|
|
+ slot->range = slot->max - slot->min;
|
|
|
+ slot->show_markers = style->show_markers;}
|
|
|
}
|
|
|
NK_API void
|
|
|
nk_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,
|
|
|
i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
|
|
|
color = g->slots[slot].highlight;
|
|
|
}
|
|
|
- nk_fill_rect(out, bounds, 0, color);
|
|
|
+ if (g->slots[slot].show_markers) {
|
|
|
+ nk_fill_rect(out, bounds, 0, color);
|
|
|
+ }
|
|
|
g->slots[slot].index += 1;
|
|
|
return ret;
|
|
|
}
|
|
@@ -28752,7 +28759,9 @@ nk_chart_push_line(struct nk_context *ctx, struct nk_window *win,
|
|
|
color = g->slots[slot].highlight;
|
|
|
}
|
|
|
}
|
|
|
- nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color);
|
|
|
+ if (g->slots[slot].show_markers) {
|
|
|
+ nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color);
|
|
|
+ }
|
|
|
|
|
|
/* save current data point position */
|
|
|
g->slots[slot].last.x = cur.x;
|