New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI PieChart Tooltip

Updated on Nov 13, 2026

The Telerik UI for .NET MAUI PieChart displays a tooltip with information about a slice when you add a ChartTooltipBehavior to the ChartBehaviors collection of the chart. The tooltip works with the PieSeries and the DonutSeries.

PieChart Tooltip default look, custom template, custom content and style

Enable the Tooltip

The following example demonstrates how to add a ChartTooltipBehavior to the ChartBehaviors collection of the RadPieChart. The tooltip opens when you tap a slice and is placed at the data point.

  1. Define the RadPieChart with a ChartTooltipBehavior in XAML:
XAML
<charts:RadPieChart Grid.Row="1">
    <charts:RadPieChart.BindingContext>
        <local:PieTooltipViewModel />
    </charts:RadPieChart.BindingContext>
    <charts:RadPieChart.ChartBehaviors>
        <charts:ChartTooltipBehavior x:Name="tooltipBehavior"
                                     TriggerMode="Tap"
                                     PlacementMode="DataPoint" />
    </charts:RadPieChart.ChartBehaviors>
    <charts:RadPieChart.Series>
        <charts:PieSeries DisplayName="Product Sales"
                          ValueBinding="Value"
                          LabelBinding="Category"
                          LabelOffsetFraction="0.85"
                          ItemsSource="{Binding Data}" />
    </charts:RadPieChart.Series>
</charts:RadPieChart>
  1. Add the charts namespace. The local namespace used in the examples points to the namespace in which the data model and the ViewModel are defined.
XAML
xmlns:charts="clr-namespace:Telerik.Maui.Controls.Charts;assembly=Telerik.Maui.Controls"
  1. Define the data model. The PieDonutTooltipInfo record is used to pass additional data to the tooltip through the TooltipOpening event:
C#
public sealed record PieDonutTooltipPoint(string Category, double Value, double Target, string Region, int Units);

public sealed record PieDonutTooltipInfo(string VsTarget, Color TrendColor);
  1. Define the ViewModel:
C#
public class PieTooltipViewModel
{
    public ObservableCollection<PieDonutTooltipPoint> Data { get; } = new ObservableCollection<PieDonutTooltipPoint>
    {
        new PieDonutTooltipPoint("Laptops", 450, 400, "North America", 1350),
        new PieDonutTooltipPoint("Phones", 300, 320, "Europe", 2480),
        new PieDonutTooltipPoint("Tablets", 150, 140, "Asia Pacific", 920),
        new PieDonutTooltipPoint("Accessories", 100, 120, "Latin America", 3150),
    };
}

For a runnable example with the PieChart Tooltip scenarios, go to the SDKBrowser Demo Application and navigate to the Charts > Tooltip category.

Display the Tooltip

To open the tooltip, set the TriggerMode (enum of type Telerik.Maui.Controls.Charts.ChartTooltipTriggerMode) property of the ChartTooltipBehavior. The available options are:

  • Tap—The tooltip opens when you tap a data point. Default on mobile platforms.
  • Hover—The tooltip opens when you hover over a data point. Default on desktop platforms.
  • Hold—The tooltip opens when you press and hold a data point.

To define a delay before the tooltip is shown or hidden, use the following properties of the ChartTooltipBehavior:

  • HoverDelay (int)—Defines the delay in milliseconds before the tooltip is shown. Applies only to the Hover trigger mode and only to the initial show. The default value is 0.
  • HideDelay (int)—Defines the delay in milliseconds before the tooltip is hidden. For the Hold trigger mode, the delay starts when the press is released. This property has no effect for the Hover trigger mode.

Position the Tooltip

To position the tooltip, use the PlacementMode (enum of type Telerik.Maui.Controls.Charts.ChartTooltipPlacementMode) property. The available options are:

  • Pointer (default)—Places the tooltip at the pointer or tap position.
  • DataPoint—Places the tooltip at a fixed position relative to the data point.

Format the Tooltip Label

To format the value displayed in the tooltip, use the TooltipLabelFormat (string) property of the ChartTooltipBehavior. The format string is applied to the value of the data point. For example, to display a percentage with two decimal places, set the TooltipLabelFormat to "{0:P2}".

Events

The ChartTooltipBehavior exposes the TooltipOpening event, which is raised before the tooltip opens. The ChartTooltipOpeningEventArgs expose the Series, SeriesIndex, PointIndex, DataItem, Value, Category, FormattedValue, and SeriesColor properties, and the AdditionalData property, which you can set to pass custom data to the TooltipContentTemplate.

The following example calculates the difference between the actual value and the target value, picks a trend color, and passes both to the tooltip through the AdditionalData property. The data is then displayed by the TooltipContentTemplate:

C#
private void OnTooltipOpening(object sender, ChartTooltipOpeningEventArgs e)
{
    if (e.DataItem is not PieDonutTooltipPoint point)
    {
        return;
    }

    double percentage = ((point.Value - point.Target) / point.Target) * 100.0;
    string sign = percentage >= 0.0 ? "+" : string.Empty;
    string formattedPercentage = percentage.ToString("0", CultureInfo.InvariantCulture);
    Color trendColor = percentage >= 0.0 ? Color.FromArgb("#00897B") : Color.FromArgb("#B73562");
    e.AdditionalData = new PieDonutTooltipInfo($"{sign}{formattedPercentage}% vs target", trendColor);
}

Styling the Tooltip

Use the TooltipStyle property of the ChartTooltipBehavior to apply a Style with target type ChartTooltip. Set the following properties to style the tooltip's appearance:

  • TextColor (Color)—Defines the color of the tooltip text.
  • FontSize (double)—Defines the font size of the tooltip text.
  • FontFamily (string)—Defines the font family of the tooltip text.
  • FontAttributes (FontAttributes)—Defines the font attributes of the tooltip text.
  • BackgroundColor (Color)—Defines the background color of the tooltip.
  • Border properties (BorderColor, BorderBrush BorderThickness, CornerRadius)—Define the border of the tooltip.
  • ContentPadding (Thickness)—Defines the padding of the tooltip content.

The following example demonstrates how to style the tooltip and format its label.

  1. Define the Style with target type ChartTooltip in the page resources:
XAML
<Style x:Key="TooltipStyle"
       TargetType="charts:ChartTooltip">
    <Setter Property="BackgroundColor" Value="#F2EFF9" />
    <Setter Property="BorderColor" Value="#8660C5" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="CornerRadius" Value="8" />
    <Setter Property="ContentPadding" Value="12, 8" />
    <Setter Property="TextColor" Value="#674BB2" />
    <Setter Property="FontSize" Value="15" />
    <Setter Property="FontAttributes" Value="Bold" />
</Style>
  1. Set the style to the TooltipStyle property of the ChartTooltipBehavior. The example also sets the TooltipLabelFormat property to format the displayed value:
XAML
<charts:RadPieChart>
    <charts:RadPieChart.BindingContext>
        <local:PieTooltipViewModel />
    </charts:RadPieChart.BindingContext>
    <charts:RadPieChart.ChartBehaviors>
        <charts:ChartTooltipBehavior TooltipStyle="{StaticResource TooltipStyle}"
                                     PlacementMode="DataPoint"
                                     TooltipLabelFormat="Sales: ${0:N0}K" />
    </charts:RadPieChart.ChartBehaviors>
    <charts:RadPieChart.Series>
        <charts:DonutSeries DisplayName="Product Sales"
                            ValueBinding="Value"
                            LabelBinding="Category"
                            LabelOffsetFraction="0.85"
                            ItemsSource="{Binding Data}" />
    </charts:RadPieChart.Series>
</charts:RadPieChart>

Customizing the Tooltip Content

Use the TooltipContentTemplate property to define custom content. The binding context of the template is a ChartTooltipContext object.

The following example displays the series color, the category, the series name, properties from the business object, the formatted value, and the AdditionalData set in the TooltipOpening event.

  1. Define the TooltipStyle and the TooltipContentTemplate in the page resources:
XAML
<Style x:Key="TooltipStyle"
       TargetType="charts:ChartTooltip">
    <Setter Property="BackgroundColor" Value="#FFFFFF" />
    <Setter Property="BorderColor" Value="#8660C5" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="CornerRadius" Value="10" />
    <Setter Property="ContentPadding" Value="12" />
    <Setter Property="TextColor" Value="#4A4949" />
</Style>
<DataTemplate x:Key="TooltipContentTemplate"
              x:DataType="charts:ChartTooltipContext">
    <VerticalStackLayout Spacing="6"
                         MinimumWidthRequest="150">
        <HorizontalStackLayout Spacing="8">
            <BoxView Color="{Binding SeriesColor}"
                     WidthRequest="12"
                     HeightRequest="12"
                     CornerRadius="6"
                     VerticalOptions="Center" />
            <Label Text="{Binding Category}"
                   TextColor="#674BB2"
                   FontAttributes="Bold"
                   VerticalOptions="Center" />
        </HorizontalStackLayout>
        <Label Text="{Binding Series.DisplayName}"
               TextColor="#8660C5"
               FontSize="12" />
        <BoxView Color="#EDEAF6"
                 HeightRequest="1" />
        <VerticalStackLayout BindingContext="{Binding DataItem}"
                             x:DataType="local:PieDonutTooltipPoint"
                             Spacing="2">
            <Label Text="{Binding Region, StringFormat='Top market: {0}'}"
                   FontSize="12" />
            <Label Text="{Binding Units, StringFormat='Units sold: {0:N0}'}"
                   FontSize="12" />
        </VerticalStackLayout>
        <Label Text="{Binding FormattedValue}"
               TextColor="#8660C5"
               FontSize="20"
               FontAttributes="Bold" />
        <Label BindingContext="{Binding AdditionalData}"
               x:DataType="local:PieDonutTooltipInfo"
               Text="{Binding VsTarget}"
               TextColor="{Binding TrendColor}"
               FontSize="12"
               FontAttributes="Bold" />
    </VerticalStackLayout>
</DataTemplate>
  1. Set the style and the template to the ChartTooltipBehavior, and subscribe to the TooltipOpening event:
XAML
<charts:RadPieChart>
    <charts:RadPieChart.BindingContext>
        <local:PieTooltipViewModel />
    </charts:RadPieChart.BindingContext>
    <charts:RadPieChart.ChartBehaviors>
        <charts:ChartTooltipBehavior TooltipStyle="{StaticResource TooltipStyle}"
                                     TooltipContentTemplate="{StaticResource TooltipContentTemplate}"
                                     TooltipLabelFormat="${0:N0}K"
                                     TooltipOpening="OnTooltipOpening" />
    </charts:RadPieChart.ChartBehaviors>
    <charts:RadPieChart.Series>
        <charts:DonutSeries DisplayName="Product Sales"
                            ValueBinding="Value"
                            LabelBinding="Category"
                            LabelOffsetFraction="0.85"
                            ItemsSource="{Binding Data}" />
    </charts:RadPieChart.Series>
</charts:RadPieChart>
  1. Add the TooltipOpening event handler that sets the AdditionalData:
C#
private void OnTooltipOpening(object sender, ChartTooltipOpeningEventArgs e)
{
    if (e.DataItem is not PieDonutTooltipPoint point)
    {
        return;
    }

    double percentage = ((point.Value - point.Target) / point.Target) * 100.0;
    string sign = percentage >= 0.0 ? "+" : string.Empty;
    string formattedPercentage = percentage.ToString("0", CultureInfo.InvariantCulture);
    Color trendColor = percentage >= 0.0 ? Color.FromArgb("#00897B") : Color.FromArgb("#B73562");
    e.AdditionalData = new PieDonutTooltipInfo($"{sign}{formattedPercentage}% vs target", trendColor);
}

Customizing the Tooltip Control Template

To fully change the tooltip appearance, set the ControlTemplate property of the ChartTooltip through the TooltipStyle. Use a ContentPresenter to display the tooltip content, and bind to the ChartTooltip properties, such as the text properties and the Context, through a RelativeSource binding.

The following example displays the series color and the category above the tooltip content on a gradient background.

  1. Define the ControlTemplate and the Style that applies it in the page resources:
XAML
<ControlTemplate x:Key="TooltipControlTemplate">
    <Grid>
        <Grid.Resources>
            <Style TargetType="Label">
                <Setter Property="TextColor"
                        Value="{Binding TextColor, Source={RelativeSource AncestorType={x:Type charts:ChartTooltip}}, x:DataType=charts:ChartTooltip}" />
                <Setter Property="FontSize"
                        Value="{Binding FontSize, Source={RelativeSource AncestorType={x:Type charts:ChartTooltip}}, x:DataType=charts:ChartTooltip}" />
                <Setter Property="FontFamily"
                        Value="{Binding FontFamily, Source={RelativeSource AncestorType={x:Type charts:ChartTooltip}}, x:DataType=charts:ChartTooltip}" />
                <Setter Property="FontAttributes"
                        Value="{Binding FontAttributes, Source={RelativeSource AncestorType={x:Type charts:ChartTooltip}}, x:DataType=charts:ChartTooltip}" />
            </Style>
        </Grid.Resources>
        <telerik:RadBorder BorderColor="#EDEAF6"
                           BorderThickness="1"
                           CornerRadius="12"
                           Padding="12, 8">
            <telerik:RadBorder.Background>
                <LinearGradientBrush StartPoint="0, 0"
                                     EndPoint="1, 1">
                    <GradientStop Color="#8660C5" Offset="0" />
                    <GradientStop Color="#674BB2" Offset="1" />
                </LinearGradientBrush>
            </telerik:RadBorder.Background>
            <VerticalStackLayout Spacing="4">
                <HorizontalStackLayout Spacing="6">
                    <BoxView Color="{Binding Context.SeriesColor, Source={RelativeSource AncestorType={x:Type charts:ChartTooltip}}, x:DataType=charts:ChartTooltip}"
                             WidthRequest="10"
                             HeightRequest="10"
                             CornerRadius="5"
                             VerticalOptions="Center" />
                    <Label Text="{Binding Context.Category, Source={RelativeSource AncestorType={x:Type charts:ChartTooltip}}, x:DataType=charts:ChartTooltip}"
                           TextColor="#EDEAF6"
                           FontSize="12"
                           FontAttributes="None"
                           VerticalOptions="Center" />
                </HorizontalStackLayout>
                <ContentPresenter />
            </VerticalStackLayout>
        </telerik:RadBorder>
    </Grid>
</ControlTemplate>

<Style x:Key="TooltipControlTemplateStyle"
       TargetType="charts:ChartTooltip">
    <Setter Property="ControlTemplate" Value="{StaticResource TooltipControlTemplate}" />
    <Setter Property="TextColor" Value="#FFFFFF" />
    <Setter Property="FontSize" Value="16" />
    <Setter Property="FontAttributes" Value="Bold" />
</Style>
  1. Set the style to the TooltipStyle property of the ChartTooltipBehavior:
XAML
<charts:RadPieChart>
    <charts:RadPieChart.BindingContext>
        <local:PieTooltipViewModel />
    </charts:RadPieChart.BindingContext>
    <charts:RadPieChart.ChartBehaviors>
        <charts:ChartTooltipBehavior TooltipStyle="{StaticResource TooltipControlTemplateStyle}"
                                     TooltipLabelFormat="${0:N0}K" />
    </charts:RadPieChart.ChartBehaviors>
    <charts:RadPieChart.Series>
        <charts:PieSeries DisplayName="Product Sales"
                          ValueBinding="Value"
                          LabelBinding="Category"
                          LabelOffsetFraction="0.85"
                          ItemsSource="{Binding Data}" />
    </charts:RadPieChart.Series>
</charts:RadPieChart>
  1. Add the telerik namespace, which is used for the RadBorder in the ControlTemplate:
XAML
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"

See Also