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

Pie Chart Label Problem

1 Answer 81 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Barry
Top achievements
Rank 1
Barry asked on 27 Mar 2012, 09:06 PM
The chart below only shows the 'Key' value in the Labels.

What modifications are required to show the 'Key' and the 'Value' in the labels.

Thank you, Barry

_______________________________________________________________________________________


<
UserControl
    xmlns:vm="clr-namespace:Mcpic.Modules.EquipmentManager.Views"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:bi="clr-namespace:Mcpic.Core.Business.Interactivity;assembly=Mcpic.Core.Silverlight.Business"
    xmlns:models="clr-namespace:Mcpic.Core.Business.Model;assembly=Mcpic.Core.Silverlight.Business"
    xmlns:ctrls="clr-namespace:Mcpic.Core.Controls;assembly=Mcpic.Core.Controls"
    x:Class="Mcpic.Modules.EquipmentManager.Views.CommChartView"
    mc:Ignorable="d"
    d:DesignHeight="600" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:CommChartViewModel, IsDesignTimeCreatable=False}">
 
    <!-- Resources -->
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Mcpic.Modules.EquipmentManager;component/Assets/BusinessResourceDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
 
    <!-- Layout Root -->
    <Grid x:Name="LayoutRoot">
        <toolkit:BusyIndicator IsBusy="{Binding IsBusy}">
            <Grid>
                <telerik:RadChart
                    ItemsSource="{Binding Items}">
                    <telerik:RadChart.DefaultSeriesDefinition>
                        <telerik:PieSeriesDefinition>
                            <telerik:PieSeriesDefinition.LabelSettings>
                                <telerik:RadialLabelSettings
                                    ShowZeroValueLabels="True"
                                    SpiderModeEnabled="True"
                                    ShowConnectors="True"  />
                            </telerik:PieSeriesDefinition.LabelSettings>
                        </telerik:PieSeriesDefinition>
                    </telerik:RadChart.DefaultSeriesDefinition>
                    <telerik:RadChart.DefaultView>
                        <telerik:ChartDefaultView>
                            <telerik:ChartDefaultView.ChartLegend>
                                <telerik:ChartLegend Visibility="Collapsed"  />
                            </telerik:ChartDefaultView.ChartLegend>
                             
                            <!--This blows Up-->
                            <telerik:ChartDefaultView.ChartArea>
                                <telerik:ChartArea>
                                    <telerik:AxisY  DefaultLabelFormat="#VAL"/>
                                </telerik:ChartArea>
                            </telerik:ChartDefaultView.ChartArea>
                           <!--End:This blows Ip-->
                             
                        </telerik:ChartDefaultView>
                    </telerik:RadChart.DefaultView>
                    <telerik:RadChart.SeriesMappings>
                        <telerik:SeriesMapping>
                            <telerik:SeriesMapping.ItemMappings>
                                <telerik:ItemMapping FieldName="Key"
                                                     DataPointMember="Label" />
                                <telerik:ItemMapping FieldName="Value"
                                                     DataPointMember="YValue"  />
                            </telerik:SeriesMapping.ItemMappings>
                        </telerik:SeriesMapping>
                    </telerik:RadChart.SeriesMappings>
                </telerik:RadChart>
            </Grid>
        </toolkit:BusyIndicator>
    </Grid>
</UserControl>

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 28 Mar 2012, 04:58 PM
Hi Barry,

Thanks for contacting us.
You may use the ItemLabelFormat property of the series and set as many properties of your business object as you want to be visualized in a single label.
For the purpose you should use a #DATAITEM token. More about it, as well as code samples can be found in our documentation.

Kind regards,
Evgenia
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Chart
Asked by
Barry
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or