Label Style for RadPieChart

7 posts, 0 answers
  1. Sarper
    Sarper avatar
    22 posts
    Member since:
    Aug 2012

    Posted 27 Jun 2012 Link to this post

    Hello Telerik Team,

       I am using your RadControls. They have all features i need for my project. But i just wanted to know that;

    Is it possible to create a label style that shows information about a pie of the chart and the pie and its location are connected via an arrowed line.

    Here is the view that i wanted; http://www.altova.com/images/shots/xml-pie-chart.png

    Thank you,
    Sarper
  2. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 02 Jul 2012 Link to this post

    Hello,

    Currently RadChartView does not support label connectors. Regarding your question about styling pie labels, it can be achieved like this:
    <UserControl.Resources>
            <Style x:Key="LabelStyle" TargetType="TextBlock">
                <Setter Property="FontFamily" Value="Segoe UI" />
                <Setter Property="FontSize" Value="11" />
                <Setter Property="TextAlignment" Value="Center"/>
                <Setter Property="Foreground" Value="CadetBlue" />
            </Style>
        </UserControl.Resources>
    and then set this style as your ChartSeriesLabelDefinition DefaultVisualStyle:

    <chartView:PieSeries.LabelDefinitions>
        <chartView:ChartSeriesLabelDefinition Margin="-8,0,0,0" DefaultVisualStyle="{StaticResource LabelStyle}" />
    </chartView:PieSeries.LabelDefinitions>

    Hope this helps.

    Regards,
    Peshito
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Sarper
    Sarper avatar
    22 posts
    Member since:
    Aug 2012

    Posted 14 Jul 2012 Link to this post

    Hello Peshito,

    Currently, I am using that type of labels, but i need connectors like view. Is there a property which i can use it to get a view like that i want?

    Thank you for your assistance,
    Sarper
  5. Nikolay
    Admin
    Nikolay avatar
    385 posts

    Posted 18 Jul 2012 Link to this post

    Hello Sarper,

    Unfortunately RadChartView does not currently support the labels connectors functionality. Nevertheless, our developers have been notified of this requirement and will consider it for future versions of the control.

    All the best,
    Nikolay
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Tim
    Tim avatar
    114 posts
    Member since:
    Aug 2011

    Posted 09 Aug 2012 Link to this post

    Hello. One more question about label styling. Using RadChart I did this:
    <Style x:Key="myLabelStyle" TargetType="telerik:SeriesItemLabel">
        <Setter Property="Foreground" Value="#FF000000" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:SeriesItemLabel">
                    <Canvas>
                        <Polyline x:Name="PART_Connector" Style="{TemplateBinding ConnectorStyle}" />
                        <Border x:Name="PART_TextContainer" Style="{TemplateBinding LabelStyle}"
                                Canvas.Left="0" Canvas.Top="0">
                            <TextBlock Text="{Binding DataItem.Label}" Visibility="{Binding DataItem.LabelVisibility}" MaxWidth="60" TextWrapping="NoWrap" ToolTipService.ToolTip="{TemplateBinding Content}" />
                        </Border>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    The interesting point here is LabelVisibility. I can display or not display a pie slice label depending on a property value. How can I achieve something like this with the new RadChartView? How can I access a "DataItem" object of a pie chart? How can I change the template? What is the TargetType?

    Thanks a lot,Tim.
  7. Sia
    Admin
    Sia avatar
    667 posts

    Posted 14 Aug 2012 Link to this post

    Hello Tim,

    Unfortunately currently this is not possible with ChartView. I have logged this feature request and your inquiry is already forwarded to our developers.

    Kind regards,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. Tim
    Tim avatar
    114 posts
    Member since:
    Aug 2011

    Posted 14 Aug 2012 Link to this post

    Sia, thanks a lot for your help and support! Hope that this will be added soon - it is double important as there is also no "smart labeling" at the moment! And a good looking labeling is more than important! So, thanks again and please give my best wishes to the developers! :)
Back to Top
DevCraft banner