ant-design-charts-blazor icon indicating copy to clipboard operation
ant-design-charts-blazor copied to clipboard

Localize "Total" Label in Donut Chart

Open NPadrutt opened this issue 5 years ago • 0 comments

I have a donut chart defined with:


<Donut @ref="WorkHistorySpreadingChart" Data="SpreadingStatisticItems" Config="ConfigSpreading" TItem="StatisticItem" />

protected DonutConfig ConfigSpreading { get; private set; } = new DonutConfig
        {
            ForceFit = true,
            Color = new[] { "#314A9B", "#9D4FA0", "#E45E8D", "#FF8671", "#FFBD5E", "#F9F871", "#6154A2", "#F1F1E6" },
            Theme = "dark",
            Radius = 0.8,
            Padding = "auto",
            AngleField = "effort",
            ColorField = "customer"
        };

Here I want to localize the "Total" label. I saw in the source code that I can set:

Statistic = new DonutViewConfigStatistic { Visible = true }, and in the OnInitializedAsync Method:

ConfigSpreading.Statistic.TotalLabel = Localizer["TotalLabel"];

How is this option intended to use?

But as soon as I set the Statistic Property the chart is no longer rendered.

NPadrutt avatar Nov 16 '20 22:11 NPadrutt