Creating a Pie chart

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    26 posts
    Member since:
    Apr 2009

    Posted 27 May 2009 Link to this post


    I have the following code:

                PieSeriesDefinition definition = new PieSeriesDefinition();  
                definition.LegendDisplayMode = LegendDisplayMode.DataPointLabel;  
                radChart1.DefaultSeriesDefinition = definition;  
                DataSeries DS = new DataSeries();  
                DataPoint DP = new DataPoint();  
                DS.LegendLabel = "Over25";  
                DP.YValue = 66;  
                DataSeries DS2 = new DataSeries();  
                DataPoint DP2 = new DataPoint();  
                DS2.LegendLabel = "Over20";  
                DP2.YValue = 100;  
                DataSeries DS3 = new DataSeries();  
                DataPoint DP3 = new DataPoint();  
                DS3.LegendLabel = "Over15";  
                DP3.YValue = 120;  
                DataSeries DS4 = new DataSeries();  
                DataPoint DP4 = new DataPoint();  
                DS4.LegendLabel = "Over10";  
                DP4.YValue = 113;  
                DataSeries DS5 = new DataSeries();  
                DataPoint DP5 = new DataPoint();  
                DS5.LegendLabel = "Under10";  
                DP5.YValue = 178;  

    But this is producing a bar chart. how do I make it a Pie chart?

  2. Giuseppe
    Giuseppe avatar
    2363 posts

    Posted 28 May 2009 Link to this post

    Hi Kevin,

    RadChart.DefaultSeriesDefinition is taken into account in databinding scenarios. When you are creating the DataSeries manually, you need to set the respective DataSeries.Definition property for each series.

    Hope this helps.

    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.
Back to Top