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

[Solved] Text inside of donut + weird legend labels

2 Answers 155 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.
Andreas
Top achievements
Rank 2
Andreas asked on 20 Dec 2012, 05:24 PM
Hello Telerik,

1) First off, is there any easy way of putting text within the donut chart? Example:
http://24.media.tumblr.com/tumblr_lp7yr3ulWQ1qg3y5xo1_500.png

So far I've just been using the margin attribute in the textblock tag to do this, but it doesn't really work out that well.

2) When I'm binding RadLegendControl with {Binding Title} I get the percentage of respective part of the pie chart, not the actual title (which should be text from the List:
data.Add(new Data { Category = "Test1", Value =10 });
data.Add(new Data { Category = "Test2", Value = 20 });

I've tried setting {Binding Category}, but XAML didn't like that.

Thanks!

2 Answers, 1 is accepted

Sort by
0
Andreas
Top achievements
Rank 2
answered on 20 Dec 2012, 06:14 PM
I partly solved the text inside the donut by using this; since the donut was wrapped in a fitting grid. However, I'd still love to know if there's any other method, preferred by you, to do this, as my method might not always work.
HorizontalAlignment="Center" VerticalAlignment="Center"
0
Ivaylo Gergov
Telerik team
answered on 24 Dec 2012, 03:25 PM
Hello Andreas,

At this point we do not provide such functionality. However you can log this as a feature request in our Ideas and Feedback Portal where you can also vote for already existing one and follow their status.

About the other question - in order to generate custom LegendTitles you can use DoughnutSeries.LegendTitleBinding property and bind it to your Category property. Here's an example:
<telerik:DoughnutSeries.LegendTitleBinding>
    <telerik:PropertyNameDataPointBinding PropertyName="Category"/>
</telerik:DoughnutSeries.LegendTitleBinding>

I hope this information is useful. Let me know if I can assist you in some other way.

 

Kind regards,
Ivaylo Gergov
the Telerik team
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
Andreas
Top achievements
Rank 2
Answers by
Andreas
Top achievements
Rank 2
Ivaylo Gergov
Telerik team
Share this question
or