How to remove gradient color from RadPieChart ?

2 posts, 0 answers
  1. irem
    irem avatar
    5 posts
    Member since:
    Oct 2016

    Posted 22 Dec 2016 Link to this post

    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,

  2. Ves
    Admin
    Ves avatar
    2916 posts

    Posted 27 Dec 2016 Link to this post

    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
Back to Top