Fixed bug where piecharts with many segments crashed.
[pspp-builds.git] / src / output / charts / barchart.c
index 7869d5d6bd4355f71f8e82ee917f43edd95edb19..88a1d741ddf9199f08404d49096de62dada0a373 100644 (file)
@@ -148,7 +148,7 @@ draw_barchart(struct chart *ch, const char *title,
        {
 
          pl_savestate_r(ch->lp);
-         pl_fillcolorname_r(ch->lp,data_colour[sc]);
+         pl_fillcolorname_r(ch->lp,data_colour[sc % N_CHART_COLOURS]);
 
          switch ( opt )
            {