hi,
I am making dynamic chats controls, i am getting problems in settings colors of chart in plot area and text color of legend. I am passing colors in series items , the colors drawn in the chart is of gradient not solid. Secondly the legend items text color is not changed w r t skin. eg i am using black skin , all items of the chart has been changed to white except the legend color. note that i am making legend dynamically w . r. t series items.
Here is my code.
//passing series to chart , with series items and colors
ChartSeries csud = new ChartSeries();
csud.Type = ChartSeriesType.Pie;
csud.AddItem(7000, "Total",Color.Red);
csud.AddItem(3500, "Projected",Color.Blue);
csud.AddItem(2000, "Used",Color.Green);
csud.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;
//making dynamic legend according to chart series items.
if (RadChart1.Series.Count == 1)
{
int j = 0;
for (j = 0; j < RadChart1.Series[0].Items.Count; j++)
{
LabelItem lblitem = new LabelItem();
lblitem.TextBlock.Text = RadChart1.Series[0].Items[j].Label.TextBlock.Text;
RadChart1.Legend.Items.Add(lblitem);
RadChart1.Legend.Items[j].Marker.Appearance.FillStyle.MainColor = RadChart1.Series[0].Items[j].Appearance.FillStyle.MainColor;
}
}
Regards.
Muhammad Shoaib
I am making dynamic chats controls, i am getting problems in settings colors of chart in plot area and text color of legend. I am passing colors in series items , the colors drawn in the chart is of gradient not solid. Secondly the legend items text color is not changed w r t skin. eg i am using black skin , all items of the chart has been changed to white except the legend color. note that i am making legend dynamically w . r. t series items.
Here is my code.
//passing series to chart , with series items and colors
ChartSeries csud = new ChartSeries();
csud.Type = ChartSeriesType.Pie;
csud.AddItem(7000, "Total",Color.Red);
csud.AddItem(3500, "Projected",Color.Blue);
csud.AddItem(2000, "Used",Color.Green);
csud.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;
//making dynamic legend according to chart series items.
if (RadChart1.Series.Count == 1)
{
int j = 0;
for (j = 0; j < RadChart1.Series[0].Items.Count; j++)
{
LabelItem lblitem = new LabelItem();
lblitem.TextBlock.Text = RadChart1.Series[0].Items[j].Label.TextBlock.Text;
RadChart1.Legend.Items.Add(lblitem);
RadChart1.Legend.Items[j].Marker.Appearance.FillStyle.MainColor = RadChart1.Series[0].Items[j].Appearance.FillStyle.MainColor;
}
}
Regards.
Muhammad Shoaib