Lines Matching defs:chart
5231 struct nk_style_chart chart;
5340 struct nk_chart chart;
14286 struct nk_style_chart *chart;
14622 /* chart */
14623 chart = &style->chart;
14624 nk_zero_struct(*chart);
14625 chart->background = nk_style_item_color(table[NK_COLOR_CHART]);
14626 chart->border_color = table[NK_COLOR_BORDER];
14627 chart->selected_color = table[NK_COLOR_CHART_COLOR_HIGHLIGHT];
14628 chart->color = table[NK_COLOR_CHART_COLOR];
14629 chart->padding = nk_vec2(4,4);
14630 chart->border = 0;
14631 chart->rounding = 0;
24037 struct nk_chart *chart;
24050 chart = &ctx->current->layout->chart;
24051 nk_zero(chart, sizeof(*chart));
24057 chart = &win->layout->chart;
24058 style = &config->chart;
24060 /* setup basic generic chart */
24061 nk_zero(chart, sizeof(*chart));
24062 chart->x = bounds.x + style->padding.x;
24063 chart->y = bounds.y + style->padding.y;
24064 chart->w = bounds.w - 2 * style->padding.x;
24065 chart->h = bounds.h - 2 * style->padding.y;
24066 chart->w = NK_MAX(chart->w, 2 * style->padding.x);
24067 chart->h = NK_MAX(chart->h, 2 * style->padding.y);
24069 /* add first slot into chart */
24070 {struct nk_chart_slot *slot = &chart->slots[chart->slot++];
24079 /* draw chart background */
24094 return nk_chart_begin_colored(ctx, type, ctx->style.chart.color,
24095 ctx->style.chart.selected_color, count, min_value, max_value);
24105 NK_ASSERT(ctx->current->layout->chart.slot < NK_CHART_MAX_SLOT);
24107 if (ctx->current->layout->chart.slot >= NK_CHART_MAX_SLOT) return;
24110 {struct nk_chart *chart = &ctx->current->layout->chart;
24111 struct nk_chart_slot *slot = &chart->slots[chart->slot++];
24124 nk_chart_add_slot_colored(ctx, type, ctx->style.chart.color,
24125 ctx->style.chart.selected_color, count, min_value, max_value);
24199 struct nk_chart *chart, float value, int slot)
24211 if (chart->slots[slot].index >= chart->slots[slot].count)
24213 if (chart->slots[slot].count) {
24214 float padding = (float)(chart->slots[slot].count-1);
24215 item.w = (chart->w - padding) / (float)(chart->slots[slot].count);
24218 /* calculate bounds of current bar chart entry */
24219 color = chart->slots[slot].color;;
24220 item.h = chart->h * NK_ABS((value/chart->slots[slot].range));
24222 ratio = (value + NK_ABS(chart->slots[slot].min)) / NK_ABS(chart->slots[slot].range);
24223 item.y = (chart->y + chart->h) - chart->h * ratio;
24225 ratio = (value - chart->slots[slot].max) / chart->slots[slot].range;
24226 item.y = chart->y + (chart->h * NK_ABS(ratio)) - item.h;
24228 item.x = chart->x + ((float)chart->slots[slot].index * item.w);
24229 item.x = item.x + ((float)chart->slots[slot].index);
24231 /* user chart bar selection */
24237 color = chart->slots[slot].highlight;
24240 chart->slots[slot].index += 1;
24252 NK_ASSERT(slot < ctx->current->layout->chart.slot);
24254 if (slot >= ctx->current->layout->chart.slot) return nk_false;
24257 if (win->layout->chart.slot < slot) return nk_false;
24258 switch (win->layout->chart.slots[slot].type) {
24260 flags = nk_chart_push_line(ctx, win, &win->layout->chart, value, slot); break;
24262 flags = nk_chart_push_column(ctx, win, &win->layout->chart, value, slot); break;
24278 struct nk_chart *chart;
24286 chart = &win->layout->chart;
24287 NK_MEMSET(chart, 0, sizeof(*chart));