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

[Solved] Radius on selected data point

3 Answers 49 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Lars
Top achievements
Rank 1
Lars asked on 13 Jun 2013, 02:50 PM
Using a pie chart, is there any way to alter the inner or outer radius for a specific data point (wedge) within the chart?

I see that it is possible to "explode" a segment, but I'd like to simply make one of the segments thicker (e.g., smaller inner radius, larger outer radius)

3 Answers, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 17 Jun 2013, 04:07 PM
Hello Lars,

Thank you for your question.

At this moment, RadPieChart does not support functionality for changing the inner/outer radius for a specific series point; such properties are available only for the whole series.

The segments are of type Path and you can use the SegmentStyleSelector property of the chart series to define custom style for every segment, but this will not affect the radius of the segment.

If you have any other questions or suggestions do not hesitate to contact us again.


Regards,
Rositsa Topchiyska
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Lars
Top achievements
Rank 1
answered on 17 Jun 2013, 05:08 PM
Ok, thanks.

Instead of altering the radius of the segment, what if I instead wanted to place an icon (or XAML path object) within a segment. Looking at the documentation for SegmentStyleSelector, it seems like this would be possible. Do you have any code samples available that show how to write a custom style for the segment and apply it using the selector?
0
Rosy Topchiyska
Telerik team
answered on 18 Jun 2013, 02:56 PM
Hi Lars,

The segments are objects of type Path and they can be styled via the PieChart.SegmentStyleSelector property. I have attached a project that demonstrates how to do that: you have to create a class that inherits the StyleSelector class and override the SelectStyleCore method that defines the style of each segment.

Note, however, that you cannot put additional content in the segment Path with this approach. You can achieve your desired functionality by retemplating the default content of the pie item labels. You can use the LabelDefinitions property of the Series to change the DataTemplate of the labels and put your desired content instead. Also, via the Margin property you can put the labels on the position you want.

For example:

<telerik:DoughnutSeries.LabelDefinitions>
    <telerik:ChartSeriesLabelDefinition Margin="50,0,0,0">
        <telerik:ChartSeriesLabelDefinition.Template>
            <DataTemplate>
                <Ellipse Width="30" Height="30" Fill="White" Stroke="LightGray"/>
            </DataTemplate>
        </telerik:ChartSeriesLabelDefinition.Template>
    </telerik:ChartSeriesLabelDefinition>
</telerik:DoughnutSeries.LabelDefinitions>

I hope this was useful and let me know if there is something else that I can assist you with.

Regards,
Rositsa Topchiyska
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Chart for XAML
Asked by
Lars
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Lars
Top achievements
Rank 1
Share this question
or