I'm utilizing the RadHTMLChart for a pie chart. I specify some of the series colors but not all. I have colors assigned to a variable that is referenced by the PieSeries ColorField. The ones I want to be pulled dynamically from the Skin I leave as "", empty string.
What I Have
Is there a way that in the code-behind, I could programmatically use the WebResource (or something else) to get the color(s) from the skin? I need the color for something else besides the chart. Thus I'd never leave the value for the ColorField as "" but some I'd assign specifically and some I'd assign by dynamically getting a color from the skin. It would be done in the "default" of the switch.
If there's another way to do this, I'm all ears.
Thanks.
What I Have
protected IList<
DataChart
> GetChartData()
{
IList<
DataChart
> dataCharts = new List<
DataChart
>();
int totalNumber = 0;
foreach (Summary summary in DataSource)
{
totalNumber += summary.Count;
}
foreach (Summary summary in DataSource)
{
DataChart thisChart = new DataChart(summary);
thisChart.ChartCount = Math.Round(100 / ((float)totalNumber / summary.Count),2);
thisChart.ChartLabel = summary.Code;
thisChart.ChartColor = GetColorByCode(summary.Code);
thisChart.ChartExplode = someCondition ? "true" : "";
dataCharts.Add(thisChart);
}
return dataCharts;
}
protected string GetColorByCode(string code)
{
string color;
switch (code)
{
case "BP":
color = "#d35151";
break;
case "RS":
color = "#f0e45e";
break;
case "XT":
color = "#ff6600";
break;
default:
color = "";
break;
}
return color;
}
Is there a way that in the code-behind, I could programmatically use the WebResource (or something else) to get the color(s) from the skin? I need the color for something else besides the chart. Thus I'd never leave the value for the ColorField as "" but some I'd assign specifically and some I'd assign by dynamically getting a color from the skin. It would be done in the "default" of the switch.
If there's another way to do this, I'm all ears.
Thanks.