Tooltip shows incorrect value on RadzenPieSeries hover (decimal + negative values)

Hi, I’m seeing an issue with RadzenChart → RadzenPieSeries tooltips.

Problem:
When I hover a pie slice, the tooltip shows an incorrect value (different from the underlying Value in the data source). The data labels/legend look OK, but the hover tooltip is wrong.

chrome_QFAaRyyqvY

Minimal repro:


<RadzenStack class="rz-p-0 rz-p-md-6 rz-p-lg-12" AlignItems="AlignItems.Center">
    <RadzenChart Style="height: 400px;">
        <RadzenPieSeries Data="@chartData" 
                        CategoryProperty="Name" 
                        ValueProperty="Value"
            <RadzenSeriesDataLabels Visible="true" />
        </RadzenPieSeries>
        <RadzenLegend Position="LegendPosition.Bottom" Visible="true" />
    </RadzenChart>
</RadzenStack>

@code {
    public class ChartObject
    {
        public decimal? Value { get; set; }

        public string? Name { get; set; }
    }

    ChartObject[] chartData = new ChartObject[] {
        new ChartObject
        {
            Name = "Test 1",
            Value = 8116.88M
        },
        new ChartObject
        {
            Name = "Test 2",
            Value = 3105.67M
        },
        new ChartObject
        {
            Name = "Test 3",
            Value = 169.75M
        },
        new ChartObject
        {
            Name = "Test 4",
            Value = -4000.00M
        },
    };
}

Playground repro: Playground | Radzen Blazor Components

Hi @Vangi

I’m not sure that pie charts are capable of showing negative values (not just Radzen, but in general). For example, if you change the first value to 4000 and remove the middle two, you are left with a pie chart with two segments (4000 and -4000). A total value of 0 for the chart.

How do you envisage the pie chart to look? i.e., what is 4000 or -4000 as a percentage of 0

Regards

Paul

Hi Paul,

Thanks for the feedback. I expected the chart to handle negative values (or at least fail gracefully if it couldn’t). In any case, we’ll preprocess the data and handle negatives before passing it to the chart component.

Best regards,
Vangel