For testing, I have a pie chart with 8 items. The YValue of the item will be set in the NeedDataSource event. Since I am using the Telerik skin, the first item is green, second is yellow, third is red, and so on. I need to have these color consistent since I will be referencing the color elswhere on the report.
Item1 = green
Item2 = yellow
Item3 = red
Item4 = blue
If I add only the items that have non-zero value the color will not be consistent. For example, Item2 is zero then if I add Item1 then Item3:
Item1 = green
Item3 = yellow
Item4 = red
Item5 = blue
I need to make some of the items invisible. However, setting Visible = false does NOT hide the item. Suggestion?
I also tried the Remove() method but I get "An eroor occured while processing Chart... Object reference not set to an instance of an object."
foreach (ChartSeriesItem i in responseSeries.Items)
{
...
if (i.YValue == 0)
{
i.Visible = false;
}
...
}