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

How to Change 3D Pie Chart Segment Colors

6 Answers 234 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Poorvi Singh
Top achievements
Rank 1
Poorvi Singh asked on 09 Dec 2009, 12:03 AM
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.

6 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 14 Dec 2009, 07:51 AM
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.
0
Suman Rayabharapu
Top achievements
Rank 1
answered on 07 Jan 2010, 08:02 PM
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
0
Suman Rayabharapu
Top achievements
Rank 1
answered on 07 Jan 2010, 09:11 PM

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

0
Poorvi Singh
Top achievements
Rank 1
answered on 07 Jan 2010, 10:11 PM
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
0
Dwight
Telerik team
answered on 12 Jan 2010, 08:19 AM
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.
0
Zhang
Top achievements
Rank 1
answered on 24 Aug 2012, 02:38 AM
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!
Tags
Chart
Asked by
Poorvi Singh
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Suman Rayabharapu
Top achievements
Rank 1
Poorvi Singh
Top achievements
Rank 1
Zhang
Top achievements
Rank 1
Share this question
or