I have a chart with several rows. I use ChartColorPalette to set a different color for the Foreach series automatically.
The moment I create my series, I want to read Color to give dropDownList.listItem the same backgroundColor. But, unfortunately, at this point the Color is not yet set.
Is it possible that the Series will derive its color definition from the ChartColorPalette later in the ASP.NET Rendering-Event?
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 + ";"); }
source share