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

Pie Chart adding tool tip

3 Answers 41 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 09 Jan 2014, 09:12 PM
<Grid Grid.Row="2">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition />
    </Grid.RowDefinitions>
 
    <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition Width="Auto" />
    </Grid.ColumnDefinitions>
     
     
    <telerik:RadPieChart x:Name="PieChart"
                         Palette="RainbowSelected"                                  
                             Grid.Row="1">
        <telerik:RadPieChart.Behaviors>
            <telerik:ChartTooltipBehavior HorizontalOffset="-6" VerticalOffset="-49"/>
            </telerik:RadPieChart.Behaviors>
        <telerik:RadPieChart.TooltipTemplate>
            <DataTemplate>
                <Grid>
                    <Path Data="M-1236,-441 L-1180,-441 -1180,-424 -1228,-424 -1230.5,-420 -1233,-424 -1236,-424 z"
Stretch="Fill" Fill="White" Stroke="Gray" StrokeThickness="1" />
                    <TextBlock Text="{Binding Value, StringFormat='C'}" Margin="4,3,4,9" />
                </Grid>
            </DataTemplate>
        </telerik:RadPieChart.TooltipTemplate>
        <telerik:PieSeries ValueBinding="YValue"
                               ItemsSource="{Binding Data}"
                               RadiusFactor="0.77" AllowSelect="True"
            <telerik:PieSeries.LabelDefinitions>
                <telerik:ChartSeriesLabelDefinition Margin="-8,0,0,0" />
            </telerik:PieSeries.LabelDefinitions>
            <telerik:PieSeries.LegendSettings>
                <telerik:DataPointLegendSettings TitleBinding="AxisXLabel" />
            </telerik:PieSeries.LegendSettings>
            
            <!--<telerik:PieSeries.AngleRange>
                <telerik:AngleRange StartAngle="270"
                                        SweepAngle="360" />
            </telerik:PieSeries.AngleRange>-->
        </telerik:PieSeries>
    </telerik:RadPieChart>
    <telerik:RadLegend x:Name="PieLegend"
                           Items="{Binding LegendItems, ElementName=PieChart}"
                           Grid.Row="1"
                           Grid.Column="1"/>
     
     
     
 
</Grid>


I do not want to manually map the path data. How can i assign it where it just goes over each slice ?

3 Answers, 1 is accepted

Sort by
0
Matthew
Top achievements
Rank 1
answered on 09 Jan 2014, 09:24 PM
i want to have the company and money. So two variables on it.
0
Pavel R. Pavlov
Telerik team
answered on 14 Jan 2014, 10:23 AM
Hello Matthew,

I am not sure what you have in mind. Could you please elaborate more on your requirements? Do you need to customize the tooltip of the control or you need to customize the labels? What you have in mind when you say: "map the path data"? Are you talking about binding the ItemsSource of the PieSeries?

Sending some clarifying pictures will be helpful. Thank you for your cooperation.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Matthew
Top achievements
Rank 1
answered on 14 Jan 2014, 06:18 PM
This has been solved with a support ticket. Thanks.
Tags
ChartView
Asked by
Matthew
Top achievements
Rank 1
Answers by
Matthew
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Share this question
or