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

How to use PaletteBrushes in drilldown charts

1 Answer 53 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ragavan
Top achievements
Rank 1
Ragavan asked on 06 Jan 2016, 10:19 AM

I am using drilldownchart(RadChart Hierarichal Chart). I would like to use different colors for bars. I am getting same gradient color for all bars. Please find the current working chart screenshot and expected. 

 

Can we use pallette to show different colors in drill down chart. If so please provide details and some sample project.

 Please find my XAML code here 

<Window x:Class="DrillDownHierarchicalView.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow"
Height="350"
Width="525">
<Grid>
<telerik:RadChart x:Name="radChart">
<telerik:RadChart.HierarchicalViewDescriptors>
<telerik:ChartHierarchicalViewDescriptor>
<telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
<telerik:SeriesMapping>
<telerik:ItemMapping FieldName="Sales.TotalAmount"
DataPointMember="YValue" />
<telerik:ItemMapping FieldName="Name"
DataPointMember="XCategory" />
</telerik:SeriesMapping>
</telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
</telerik:ChartHierarchicalViewDescriptor>
<telerik:ChartHierarchicalViewDescriptor>
<telerik:ChartHierarchicalViewDescriptor.Relation>
<telerik:PropertyRelation ParentPropertyName="Sales" />
</telerik:ChartHierarchicalViewDescriptor.Relation>
<telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
<telerik:SeriesMapping>
<telerik:SeriesMapping.GroupingSettings>
<telerik:GroupingSettings ShouldFlattenSeries="True">
<telerik:ChartGroupDescriptor Member="Model" />
</telerik:GroupingSettings>
</telerik:SeriesMapping.GroupingSettings>
<telerik:ItemMapping FieldName="Amount"
DataPointMember="YValue"
AggregateFunction="Sum" />
<telerik:ItemMapping FieldName="Model"
DataPointMember="XCategory" />
</telerik:SeriesMapping>
</telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
</telerik:ChartHierarchicalViewDescriptor>
</telerik:RadChart.HierarchicalViewDescriptors>
</telerik:RadChart>
</Grid>
</Window>

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 11 Jan 2016, 09:44 AM
Hi ,

We can see that you are using RadChart in your example.This control has known issues and limitations. That's why we recommend using the RadChartView suite instead of RadChart. The new charting components have better implementation and improved performance. You can read more about the difference between them in our RadChart vs. RadChartView help article.

As for your case, RadChartView doesn't support drill-down feature out of the box. However, you can implement it with custom code. You can find a runnable project in our GitHub repository which demonstrates how to implement this functionality.

With RadChartView,  you can use the BarSeries element to . There are several ways to colorize bar series as you'll find in our Styling the Chart Series help article. In brief, you might either Create Custom Palette (like in your case) or you can bound each DataPoint item color to a property from your ViewModel which is further described in Binding the Color of Series Items help article.

Please, give the new charting control a try and let us know if you need any further assistance.

Regards,
Dinko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Ragavan
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or