Fixed bug where piecharts with many segments crashed.
[pspp-builds.git] / src / output / charts / piechart.c
index c4dc0e67a8b36a0d390e9247e8ec3fc5c886e74c..4eeb10ca63af06f70f764477cd0865401c34a8c0 100644 (file)
@@ -96,7 +96,7 @@ piechart_plot(const char *title, const struct slice *slices, int n_slices)
       draw_segment(ch,
                   centre_x, centre_y, radius,
                   angle, segment_angle,
-                  data_colour[i]);
+                  data_colour[i % N_CHART_COLOURS]);
 
       /* Now add the labels */
       if ( label_x < centre_x )