scatterplot: changed colorscheme - first color is black - fixes bug#47806
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Mon, 23 May 2016 20:00:38 +0000 (22:00 +0200)
committerFriedrich Beckmann <friedrich.beckmann@gmx.de>
Mon, 23 May 2016 20:00:38 +0000 (22:00 +0200)
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.

src/output/charts/scatterplot-cairo.c

index 736d5e2ae7102c210f4022bf89ef6a37c77fd9aa..211d2d60dcdf8b2fca15713f0da53ad952f9c1ae 100644 (file)
@@ -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,