Pie Chart Label Problem

2 posts, 0 answers
  1. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 27 Mar 2012 Link to this post

    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>
  2. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 28 Mar 2012 Link to this post

    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 >>
  3. DevCraft banner
Back to Top