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

Styling Pie Chart - Feasibility of the attached style

2 Answers 97 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Manthravadi
Top achievements
Rank 2
Manthravadi asked on 21 Feb 2013, 09:00 AM
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 Answers, 1 is accepted

Sort by
0
Manthravadi
Top achievements
Rank 2
answered on 22 Feb 2013, 07:39 AM
(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?
0
Petar Kirov
Telerik team
answered on 26 Feb 2013, 10:34 AM
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.

Tags
ChartView
Asked by
Manthravadi
Top achievements
Rank 2
Answers by
Manthravadi
Top achievements
Rank 2
Petar Kirov
Telerik team
Share this question
or