X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Foutput%2Fcharts%2Fscatterplot-cairo.c;h=86e54c6e5abc1ea826364d571270d81219450054;hb=38f1759deae638712ed86675914c123ffb04f5ba;hp=736d5e2ae7102c210f4022bf89ef6a37c77fd9aa;hpb=0df9cdd3df66caf4353128feff3008289cda8115;p=pspp diff --git a/src/output/charts/scatterplot-cairo.c b/src/output/charts/scatterplot-cairo.c index 736d5e2ae7..86e54c6e5a 100644 --- a/src/output/charts/scatterplot-cairo.c +++ b/src/output/charts/scatterplot-cairo.c @@ -28,6 +28,7 @@ #include "gettext.h" #define _(msgid) gettext (msgid) +static const struct xrchart_colour black = {0,0,0}; void xrchart_draw_scatterplot (const struct chart_item *chart_item, cairo_t *cr, @@ -45,7 +46,7 @@ xrchart_draw_scatterplot (const struct chart_item *chart_item, cairo_t *cr, int byvar_width = 0; int i = 0; const struct xrchart_colour *colour; - + if (spc->byvar) byvar_width = var_get_width (spc->byvar); @@ -87,13 +88,16 @@ xrchart_draw_scatterplot (const struct chart_item *chart_item, cairo_t *cr, i--; } } + colour = &data_colour[i % XRCHART_N_COLOURS]; } - colour = &data_colour[i % XRCHART_N_COLOURS]; + else + colour = &black; + cairo_set_source_rgb (cr, colour->red / 255.0, colour->green / 255.0, colour->blue / 255.0); - + xrchart_datum (cr, geom, 0, case_data_idx (c, SP_IDX_X)->f, case_data_idx (c, SP_IDX_Y)->f);