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

PieChart tooltips

1 Answer 67 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Stuart
Top achievements
Rank 1
Stuart asked on 19 Dec 2012, 01:33 PM
I have a pie chart displaying with labels but I can't get the tooltips to display at all.

<Controls:RadChart IsHitTestVisible="False" 
                           ItemsSource="{Binding PieChartSlices}" 
                           PaletteBrushes="{Binding PieChartSlices, Converter={StaticResource PieChartToBrushCollectionConverter}}" 
                           Background="Transparent" 
                           BorderThickness="0">
            <Controls:RadChart.DefaultView>
                <Charting:ChartDefaultView>
                    <Charting:ChartDefaultView.ChartLegend>
                        <Charting:ChartLegend Visibility="Collapsed"/>
                    </Charting:ChartDefaultView.ChartLegend>
                    <Charting:ChartDefaultView.ChartArea>
                        <Charting:ChartArea Background="Transparent" SmartLabelsEnabled="True" NoDataString="" />
                    </Charting:ChartDefaultView.ChartArea>
                </Charting:ChartDefaultView>
            </Controls:RadChart.DefaultView>
            <Controls:RadChart.DefaultSeriesDefinition>
                <Charting:PieSeriesDefinition MaskVisibility="Collapsed" 
                                              RadiusFactor="0.575"
                                              LegendDisplayMode="None"
                                              ShowItemLabels="True" 
                                              ShowItemToolTips="True"
                                              SeriesItemLabelStyle="{StaticResource PieChartLabelStyle}">
                    <Charting:PieSeriesDefinition.SeriesItemTooltipStyle>
                        <Style TargetType="Charting:ItemToolTip2D">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <TextBlock Text="This is tooltip!" />
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </Charting:PieSeriesDefinition.SeriesItemTooltipStyle>
                    <Charting:PieSeriesDefinition.LabelSettings>
                        <Charting:RadialLabelSettings SpiderModeEnabled="True" ShowConnectors="True"   />
                    </Charting:PieSeriesDefinition.LabelSettings>
                </Charting:PieSeriesDefinition>
            </Controls:RadChart.DefaultSeriesDefinition>
            <Controls:RadChart.SeriesMappings>
                <Charting:SeriesMapping>
                    <Charting:SeriesMapping.ItemMappings>
                        <Charting:ItemMapping DataPointMember="YValue" FieldName="Count"/>
                    </Charting:SeriesMapping.ItemMappings>
                </Charting:SeriesMapping>
            </Controls:RadChart.SeriesMappings>
        </Controls:RadChart>

I've also tried setting the ItemToolTipFormat property instead of setting the SeriesItemTooltipStyle.

 

ItemToolTipFormat="#%"

 

 

At this stage I just want any form of tooltip to appear whether auto generated or custom styled but the ShowItemToolTips flag just doesn't seem to make any difference. Any ideas?

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Peshito
Telerik team
answered on 21 Dec 2012, 10:09 AM
Hello Stuart,

The reason why your tooltips are not shown is because you have set the IsHitTestVisible property of the chart to False. Simply change it to True and this will solve the issue.

More about IsHitTestVisible property can be found here.

Hope this helps.

All the best,
Peshito
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Stuart
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or