This is a migrated thread and some comments may be shown as answers.

Need Dynamic charting help.

1 Answer 55 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Zeeshan fawad
Top achievements
Rank 1
Zeeshan fawad asked on 08 Jul 2009, 10:09 AM
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

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 09 Jul 2009, 12:42 PM
Hello Muhammad,

I have answered in the other forum thread you have started.

Regards,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Chart (Obsolete)
Asked by
Zeeshan fawad
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or