I'm loading dataseries into a MS Chart and would like to set the legend/series colors automatically instead of having to choose manually.. Does anyone know of a good way to do that, so colors that are too close doesnt get chosen for the same chart? Thanks!
Asked
Active
Viewed 1,238 times
1 Answers
1
Are you looking for palettes? This code is straight out of the chart samples (http://archive.msdn.microsoft.com/mschart) for palettes:
// Standard palette
chart2.Palette = ChartColorPalette.BrightPastel;
// Use a custom palette
Color[] colorSet = new Color[4] { Color.Red, Color.Blue, Color.Green, Color.Purple };
chart2.PaletteCustomColors = colorSet;
chart2.Palette = ChartColorPalette.None;

zeFrenchy
- 6,541
- 1
- 27
- 36
-
-
Happy to help. If it answers the question it is customary to accept the answer. – zeFrenchy Dec 08 '11 at 11:12