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

Label Style for RadPieChart

6 Answers 116 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Sarper
Top achievements
Rank 2
Sarper asked on 27 Jun 2012, 08:50 AM
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

6 Answers, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 02 Jul 2012, 08:04 AM
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 >>

0
Sarper
Top achievements
Rank 2
answered on 14 Jul 2012, 09:20 PM
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
0
Nikolay
Telerik team
answered on 18 Jul 2012, 07:43 AM
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.

0
Tim
Top achievements
Rank 1
answered on 09 Aug 2012, 11:28 AM
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.
0
Sia
Telerik team
answered on 14 Aug 2012, 11:45 AM
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.

0
Tim
Top achievements
Rank 1
answered on 14 Aug 2012, 11:52 AM
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! :)
Tags
ChartView
Asked by
Sarper
Top achievements
Rank 2
Answers by
Peshito
Telerik team
Sarper
Top achievements
Rank 2
Nikolay
Telerik team
Tim
Top achievements
Rank 1
Sia
Telerik team
Share this question
or