Unplanned
Last Updated: 12 Sep 2025 14:08 by Bohdan
Bohdan
Created on: 12 Sep 2025 14:08
Category: Charts
Type: Bug Report
1
Tooltip template shows incorrect information about another data point when using MissingValues="@ChartSeriesMissingValues.Zero"

The Chart tooltip template receives incorrect context for another data item when there is a missing data item for the current category and the series has MissingValues="@ChartSeriesMissingValues.Zero".

Test page: https://blazorrepl.telerik.com/QzOtFwln362xLl7q57

Compare with the Kendo UI jQuery Chart: https://dojo.telerik.com/qZCFVOPQ 

Possible workarounds include:

  • Check the FormattedValue property of the tooltip context. If it's "0", while the value in the DataItem is not zero, then there is a missing data item.
    <TelerikChart Height="200px">
        <ChartSeriesItems>
            <ChartSeries Type="ChartSeriesType.Line"
                         Data="@Series1Data"
                         Field="@nameof(SalesData.Revenue)"
                         CategoryField="@nameof(SalesData.TimePeriod)"
                         MissingValues="@ChartSeriesMissingValues.Zero">
                <ChartSeriesLabels Visible="true"></ChartSeriesLabels>
                <ChartSeriesTooltip Visible="true">
                    <Template>
                        @{ var point = context.DataItem as SalesData; }
                        @if (point is not null && context.FormattedValue != "0")
                        {
                            <span>@point.Revenue</span>
                        }
                        else
                        {
                            <span>0 (no data item)</span>
                        }
                    </Template>
                </ChartSeriesTooltip>
            </ChartSeries>
        </ChartSeriesItems>
    
        <ChartCategoryAxes>
            <ChartCategoryAxis Min="@ChartCategoryAxisMin" Type="@ChartCategoryAxisType.Date"></ChartCategoryAxis>
        </ChartCategoryAxes>
    
    </TelerikChart>
  • Set MissingValues to Gap or Interpolate.
  • Provide dummy data items with a zero or null value. These dummy items depend on the Min and Max axis values and can be appended after the Chart data is retrieved from the data source, so that they are not hard-coded there.
  • Do not use a Chart tooltip template.
0 comments