Creating a custom palette in microsoft charting

后端 未结 1 1815
灰色年华
灰色年华 2021-01-27 22:53

Is there a way to create my own charting palette in which I can specify my own colors?

The ones that are available from

  chart.Palette = System.Web.UI.         


        
相关标签:
1条回答
  • 2021-01-27 23:38

    You can define your own palette using chart's PaletteCustomColors collection.

    chart.PaletteCustomColors.Add(Color.Red);
    chart.PaletteCustomColors.Add(Color.Blue);
    

    Also if you need to control a color of each datapoint use the datapoint's color:

    chart.Series[0].Points[0].Color = Color.Red;
    

    Note: Bind chart to data before setting the datapoint colors.

    0 讨论(0)
提交回复
热议问题