Not able to bind values to Chart Series Label.

2 posts, 0 answers
  1. Rakesh
    Rakesh avatar
    19 posts
    Member since:
    Feb 2012

    Posted 09 Apr 2013 Link to this post

    Hi Telerik,
    I am tryint create PieChart. I could able to generate the chart,but have difficulty in customizing label.
    Please go throught the attached code.
    I don't want default % values to display as a label's. if you locate DataItem.MainCode,that is where i am trying to change lable data. I get empty label's on chart.

    <telerik:PieSeries x:Name="PieSeries1" ShowLabels="True"    RadiusFactor="0.7" AllowSelect="True" SelectedPointOffset="0.2" 
                           IsSelected="True"  ItemsSource="{Binding PendingCertificationSatusInfosColl}" IsHitTestVisible="True"
                           ValueBinding="PendingCount"  >         
            <!--<telerik:ChartSeriesLabelDefinition Margin="-5,0,0,0" DefaultVisualStyle="{StaticResource LabelStyle}" />-->
            <telerik:ChartSeriesLabelDefinition Margin="-15,0,0,0" DefaultVisualStyle="{StaticResource LabelStyle}" 
                            <TextBlock Text="{Binding DataItem.MainCode}" 
                                           Foreground="White" /> 
                            <TextBlock Text="{Binding DataItem.PendingCount}" 
                                           Foreground="White"  /> 
            <telerik:AngleRange StartAngle="270"
                                        SweepAngle="360" /> 
            <DropShadowEffect BlurRadius="5" ShadowDepth="0"  Direction="315" Color="White"/> 

  2. Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 12 Apr 2013 Link to this post

    Hi Rakesh,

    I created a small project based on your code snippet. I altered just a few things in order to compile and run the project. Everything seems ok, I see a properly displayed pie chart with labels. Check the attached image and project for a reference. Is it possible that the Background of your project is White? Both of the TextBlocks have White foreground, so this might be the reason you do not see the labels even though they are there. Let us know how it goes.

    Kind regards,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top