From: Friedrich Beckmann Date: Mon, 23 May 2016 20:00:38 +0000 (+0200) Subject: scatterplot: changed colorscheme - first color is black - fixes bug#47806 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=795f64ee17fe01659dec6424dbf21fdaeb29ceeb;p=pspp scatterplot: changed colorscheme - first color is black - fixes bug#47806 The default data colour palette choses light colors (yellow). This patch selects black if no BY variable is selected for the scatterplot. Having a special colour palette for scatterplot will interfere with the legend coloring scheme. That would need more changes to have data points and legend having the same color palette. --- diff --git a/src/output/charts/scatterplot-cairo.c b/src/output/charts/scatterplot-cairo.c index 736d5e2ae7..211d2d60dc 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, @@ -87,8 +88,11 @@ 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,