I have a chart with multiple Series. I am using the ChartColorPalette to set foreach Series automatically a different color.
In that moment, when I am creating my Series, I want to read the Color to give a dropDownList.listItem the same backgroundColor. But unfortunately, in that very moment, the Color is still not set.
Is it possible that the Series are getting their color-definition out of the ChartColorPalette later in the Rendering-Event of ASP.NET?
Or what am I doing wrong?
Chart newChart = new Chart();
newChart.Palette = ChartColorPalette.Bright;
Series newSeries;
foreach (....)
{
newSeries = new Series();
newChart.Series.Add(newSeries);
// no color found :(
string colorName = newSeries.Color.Name
// same here
string colorName = newChart.Series[identifier].Color.Name;
myDropDownList.Items.FindByValue(identifier).Attributes.Add("style", "background: " + colorName + ";");
}