Set color of Dundas’ PieChart segments


Request by a client to control the color of segments in a Pie Chart by using Dundas component.

Here is the sample code from my case:

ChartLanduse.Series["Default"].Type = SeriesChartType.Pie;

//Water, Forest, Grassland, Cropland, Urban, Unclassified

//Index: 0, 1, 2, 3, 4, 5

ChartLanduse.Series[

"Default"].Points[0].Color = Color.Blue;

ChartLanduse.Series[

"Default"].Points[1].Color = Color.Peru;

ChartLanduse.Series[

"Default"].Points[2].Color = Color.Green;

ChartLanduse.Series[

"Default"].Points[3].Color = Color.DarkKhaki;

ChartLanduse.Series[

"Default"].Points[4].Color = Color.DarkGray;

ChartLanduse.Series["Default"].Points[5].Color = Color.Black;

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s