How to Change 3D Pie Chart Segment Colors

7 posts, 0 answers
  1. Poorvi Singh
    Poorvi Singh avatar
    4 posts
    Member since:
    Dec 2009

    Posted 08 Dec 2009 Link to this post

    We are using the RadChart for generating the 3D Pie Chart.

     

     

     

     

    <control:RadChart x:Name="RadChart1" Content="" Width="515" RenderTransformOrigin="0.278,0.758" UseDefaultLayout="True" Height="431" Canvas.Left="26" Canvas.Top="17" BorderThickness="1" Background="White" BorderBrush="#FFC9CACA">  
         <control:RadChart.DefaultSeriesDefinition> 
        <chart:BarSeriesDefinition/> 
         </control:RadChart.DefaultSeriesDefinition> 
    </control:RadChart> 

    private void SetChartData(double netIncome, double taxAmount)  
            {  
                RadChar1.DefaultView.ChartArea.DataSeries.Clear();  
     
                var data = new Dictionary<stringdouble> {{"Net Income", netIncome}, {"Tax", taxAmount}};  
                DataSeries DataSource = new DataSeries();  
     
                DataSource.Definition = new Pie3DSeriesDefinition();  
                DataSource.Definition.ItemLabelFormat = "n";  
     
                SolidColorBrush black = new SolidColorBrush(Colors.Black);  
                TaxOnIncomeChart.DefaultView.ChartTitle.Foreground = black;  
                TaxOnIncomeChart.DefaultView.ChartTitle.HorizontalAlignment = HorizontalAlignment.Center;  
                TaxOnIncomeChart.DefaultView.ChartLegend.Foreground = black;  
                TaxOnIncomeChart.DefaultView.ChartLegend.VerticalAlignment = VerticalAlignment.Center;  
                TaxOnIncomeChart.DefaultSeriesDefinition.SeriesItemLabelStyle = this.Resources["SeriesItemLabelStyle"as Style;  
     
                if (data["Net Income"] != 0.00)  
                {  
                    DataSource.Add(new Telerik.Windows.Controls.Charting.DataPoint() { YValue = data["Net Income"], LegendLabel = "Net Income" });  
                    DataSource.Add(new Telerik.Windows.Controls.Charting.DataPoint() { YValue = data["Tax"], LegendLabel = "Tax" });  
                }  
                else 
                {  
                    DataSource.Add(new Telerik.Windows.Controls.Charting.DataPoint() { YValue = 0, LegendLabel = "Net Income" });  
                    DataSource.Add(new Telerik.Windows.Controls.Charting.DataPoint() { YValue = 0, LegendLabel = "Tax" });  
                }  
     
                TaxOnIncomeChart.DefaultView.ChartArea.DataSeries.Add(DataSource);  
                TaxOnIncomeChart.DefaultView.ChartArea.Extensions.Add(new CameraExtension());  
     
            } 

    Now we want to use the styles for overwriting the default colors of 3D Pie Chart (Blue and Green). We don't want to use even the default themes available in telerik and wanted to write our own styles.

    Can you let us know how to change the colors for 3D pie Rad Chart. The code available for Color changing for 2D Pie is not working for 3D Pie charts.

    Please help.

  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 14 Dec 2009 Link to this post

    Hello Poorvi,

    Unfortunately, the Silverlight 3D currently does not have machanism for changing the styles and materials.
    We are currently working on a general approach to customizing styles in RadChart, but currently it is not clear when will it be available.

    Kind regards,
    Evtim
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Suman Rayabharapu
    Suman Rayabharapu avatar
    3 posts
    Member since:
    Jul 2009

    Posted 07 Jan 2010 Link to this post

    Hello Admin,

    Is this problem still persisting on the change of the colors.  We are actually trying to evaluate SILVERLIGHT 3D CHARTS LIKE (PIE and BAR) in our application.  We want to implement the same using Prism with MVVM.  Please give a sample if you can.

    Let us know if we can change the colors of the BARS and also the SLICES in the PIE chart, so that we can decide whether to proceed on this or not.

    Any help would be appreciated.

    Thanks,
    SumRaya
  5. Suman Rayabharapu
    Suman Rayabharapu avatar
    3 posts
    Member since:
    Jul 2009

    Posted 07 Jan 2010 Link to this post

    Hi Poorvi Singh,

    Were you able to make the color change for the chart segment in PIE and BAR 3D charts.

    Please let me know if you have done on this.

    Any help would be greatly appreciated.

     

    Thanks,

    SumRaya

  6. Poorvi Singh
    Poorvi Singh avatar
    4 posts
    Member since:
    Dec 2009

    Posted 07 Jan 2010 Link to this post

    Hi SumRaya,

    Telerik 3D Pie Chart/Bar does not support segment color changes. We spent couple of days but didn't got the any work around for this. We even tried over writing the telerik vista themes but it seems the styles for 3D is not implemented in telerik still.

    No luck till now. We are now using 2D till the time telerik don't support 3D chart styling.

    regards,
    Poorvi
  7. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 12 Jan 2010 Link to this post

    Hello Poorvi and Suman,

    We are currently working on extending the RadChart styling to provide easy way of customizing the styles of all series and items (including 2D and 3D).

    This feature is scheduled for the Q1 release.

    All the best,
    Evtim
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Zhang
    Zhang avatar
    4 posts
    Member since:
    Aug 2012

    Posted 23 Aug 2012 Link to this post

    I want use Pie 3D,but I don't know how to contral it's styles by the xaml and Iwant to know how to contral it's datasources by xaml.Can you give me an example!Thanks!
Back to Top
DevCraft banner