4 Answers, 1 is accepted
<
telerik:RadPieChart
Grid.Row
=
"1"
Background
=
"{x:Null}"
Palette
=
"{StaticResource customPalette}"
x:Name
=
"chartViewHostStatus"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
>
<
telerik:RadPieChart.Series
>
<
telerik:DoughnutSeries
ShowLabels
=
"True"
ItemsSource
=
"{Binding StatusCount}"
LabelFormat
=
"n"
ValueBinding
=
"Quantity"
>
<
telerik:DoughnutSeries.LegendSettings
>
<
telerik:DataPointLegendSettings
TitleBinding
=
"Title"
/>
</
telerik:DoughnutSeries.LegendSettings
>
</
telerik:DoughnutSeries
>
</
telerik:RadPieChart.Series
>
The above code yields something like the attached image. In this example, I was hoping to have 3 slices, one with a label of 4 making up 100% of the chart, and two with a label of 0 each accounting for 0% of the chart (in this example, with the present bound data).
Is it possible to do something like that?
Thanks,
Tom
public ChartDataPoint(string title, int quantity, HostState state)
{
Title = title;
Quantity = quantity;
State = state;
}
Hello Thomas,
To achieve your requirement, you can use the label definition feature of RadChartView. To do this, add a new instance of the ChartSeriesLabelDefinition class in the LabelDefinitions collection of the series. The ChartSeriesLabelDefinition allows you to set the label format via the Format property or the customize the label entirely by setting the Template property. Read more about this in the Label Definition article.
I hope that helps.
Regards,
Martin Ivanov
Progress Telerik