This is a migrated thread and some comments may be shown as answers.
How to remove gradient color from RadPieChart ?
1 Answer 9 Views
This is a migrated thread and some comments may be shown as answers.
irem
Top achievements
Rank 1
irem asked on 22 Dec 2016, 11:46 AM

Hello,

I am using RadPieChart and it's pallette includes two different colors. I need to get palette colors as solid instead of gradient view.

How can I remove this gradient view (please see attachment pieChart.png) from my chart ? (Currently, it looks like a border on the piechart.)

Additionally, I have attached my expected pieChart view (expectedPieChart.png). 

(Note: Attached chart view look like a donut chart instead of PieChart, I used white rounded container on the PieChart for this.)

Thanks,

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 27 Dec 2016, 07:17 AM
Hi Irem,

I believe you get this in UWP/universal chart, as the others do not feature such appearance. In order to get rid of the semi-transparent mask you will need to implement custom renderer. The process is described for iOS here. It would be similar for UWP. Once you have obtained reference to the native control, you will have to update the PieSeries.HighlightBrush property. Here is a sample implementation:

public class MyPieRenderer : PieChartRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<RadPieChart> e)
        {
            base.OnElementChanged(e);
            (this.Control as Telerik.UI.Xaml.Controls.Chart.RadPieChart).Series[0].HighlightBrush = new SolidColorBrush(Colors.Transparent);
        }
    }


Best regards,
Ves
Telerik by Progress
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
irem
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or