Styling Pie Chart - Feasibility of the attached style

3 posts, 0 answers
  1. Manthravadi
    Manthravadi avatar
    6 posts
    Member since:
    Jan 2013

    Posted 21 Feb 2013 Link to this post

    Hi, I was wondering if it was possible to style the Pie Chart as shown in the attached image file. I didn't know where to start from, and was hoping if someone from the forums could give an example on where I can start the styling from? 
  2. Manthravadi
    Manthravadi avatar
    6 posts
    Member since:
    Jan 2013

    Posted 22 Feb 2013 Link to this post

    (bump)

    I was thinking if there was a way we could style the "selected slice" of the Pie Chart so that it has the 3D-like appearance as shown in the attached screenshot. Can someone guide me in achieving it?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 26 Feb 2013 Link to this post

    Hi Siva,

    I'm afraid that the RadPieChart does not provide a way to create this 3D bump. The pie slices are visually represented with Paths, so you can apply a Style to the currently selected slice, but I'm not sure if you can achieve the desired effect.
    This how you can get the visual presenter of the currently selected pie slice:
    private void ChartSelectionBehavior_SelectionChanged(
              object sender, ChartSelectionChangedEventArgs e)
    {
        if (e.AddedPoints.Count > 0)
        {
            PieDataPoint dp = e.AddedPoints[0] as PieDataPoint;
     
            var visual = this.chart.Series[0].ChildrenOfType<Path>().
                Where(path => path.DataContext == dp).First();
     
            //Do something with the visual...
        }
    }
    Assuming you have this in XAML:
    <telerik:RadPieChart x:Name="chart">
        <telerik:RadPieChart.Behaviors>
            <telerik:ChartSelectionBehavior
                SelectionChanged="ChartSelectionBehavior_SelectionChanged"/>
        </telerik:RadPieChart.Behaviors>

     
    Kind regards,
    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top