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

No Tooltip on PieChart

1 Answer 54 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Håkan
Top achievements
Rank 1
Håkan asked on 17 Nov 2014, 09:25 AM
Hi!

I have desperately tried to get a tooltip to show up on my PieChert without success.

Here is my XAML:

<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" />
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding DataItem.Name}" Margin="4,3,4,9" />
                <TextBlock Text="{Binding DataItem.Value}" Margin="4,3,4,9" />
                <TextBlock Text="%" Margin="4,3,4,9" />
            </StackPanel>
        </Grid>
    </DataTemplate>
</telerik:RadPieChart.TooltipTemplate>

<telerik:PieSeries ItemsSource="{Binding ShiftTypes, Source={StaticResource ViewModel}}" ValueBinding="Value" RadiusFactor="0.85" />

My view model has a collecion that looks like this:
private ObservableCollection<ShiftTypesQuotaGaugeChartData> shiftTypes;
      public ObservableCollection<ShiftTypesQuotaGaugeChartData> ShiftTypes
      {
          get { return this.shiftTypes; }
          set
          {
              this.shiftTypes = value;
              this.OnPropertyChanged("ShiftTypes");
          }
      }

public class ShiftTypesQuotaGaugeChartData
{
    public string Name { get; set; }
    public int Value { get; set; }
}

The chart itself works just fine, its just the tooltip that does not popup at all.
Even tried with a simple hard coded text.

When I set a breakpoint on the binding it actually stops there.

Regards,
Håkan


1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 19 Nov 2014, 12:07 PM
Hi Håkan,

I prepared for you a project demonstrating how the ChartTooltipBehavior can be used in the RadPieChart. Please note that you need to ensure that the mouse pointer is over a specific pie slice for a short period of time before the tooltip to be visualized.

Please take a look at the attached project and let me know if it works for you.

Regards,
Pavel R. Pavlov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ChartView
Asked by
Håkan
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or