0

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!

ploink
  • 61
  • 1
  • 8

1 Answers1

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