Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
Tooltip on Legeng
posted

Hi, 

Is there any way to Bind Legend Tooltip to XamPieChart values, I mean if PieChart Shows  Label A, Value 10, Label B Value 20, Then Tooltip should show 10 When hover over A in Legend and 20 when hover over B in Legend?

Thanks, Vahagn

  • 17475
    Verified Answer
    Offline posted

    Hello Xetish,

    The LegendItemTemplate could be modified to add a tooltip for each item in the legend. Here is a code snippet for the same:
    <ig:XamPieChart.LegendItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <ContentPresenter Content="{Binding}" ContentTemplate="{Binding Series.LegendItemBadgeTemplate}"/>
                            <TextBlock Text="{Binding Item.Label}" ToolTip="{Binding Item.Spending}"/>                           
                            </StackPanel>
                        </DataTemplate>

                    </ig:XamPieChart.LegendItemTemplate>
    I have also attached a sample project regarding the same. If you have any questions or concerns feel free to let me know.

    XamPieChartTooltipLabel.zip