Hi,
I have a pie chart where I am trying to assign a color based on the series data item being returned from a stored procedure. However, no matter what I seem to do it always appears to maintain a gradient in the pie segment as well as coloring it RED.
What am I doing wrong? I have also set SkinsOverrideStyles="false"
I have a pie chart where I am trying to assign a color based on the series data item being returned from a stored procedure. However, no matter what I seem to do it always appears to maintain a gradient in the pie segment as well as coloring it RED.
What am I doing wrong? I have also set SkinsOverrideStyles="false"
protected void rcOrderTotalStages_ItemDataBound(object sender, ChartItemDataBoundEventArgs e) { //bind the legend to the report type title name from SQL data source e.SeriesItem.Name = (string)DataBinder.Eval(e.DataItem, "report_type_title") + " (" + (Int32)DataBinder.Eval(e.DataItem, "report_type_count") + ")"; e.ChartSeries.Appearance.ShowLabelConnectors = true; e.SeriesItem.ActiveRegion.Tooltip = (string)DataBinder.Eval(e.DataItem, "report_type_desc") + " (" + (Int32)DataBinder.Eval(e.DataItem, "report_type_count") + ")"; //for each of the chart series set the exploded property to true and bind a colour to the pie segment depending on status/report_type-title int ChartSeriesItemCount = e.ChartSeries.Items.Count; for (int i = 0; i < ChartSeriesItemCount; i++) { e.ChartSeries.Items[i].Appearance.Exploded = true; string status = ""; status = (string)DataBinder.Eval(e.DataItem, "report_type_title"); switch (status) { case "Delivered": e.ChartSeries.Items[i].Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid; e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Green; break; case "Bill & Hold": e.ChartSeries.Items[i].Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid; e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Green; break; case "Prep Complete": e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Green; break; case "In Prep": e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Orange; break; case "Sent To Schedule": e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Orange; break; case "On Order/Ghost Slot": e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Orange; break; case "On Order": e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Red; break; case "Stock": e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Red; break; case "Not On Stock": e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Red; break; case "Cancelled": e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Blue; break; case "Status Unknown": e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Gray; break; default: e.ChartSeries.Items[i].Appearance.FillStyle.MainColor = System.Drawing.Color.Yellow; break; } } }