This question is locked. New answers and comments are not allowed.
We are using the RadChart for generating the 3D Pie Chart.
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.
<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<string, double> {{"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.