Using HtmlRenderer for retrieving a RadzenPieSeries html

Hi everyone,

I’m currently working on a project using Radzen Blazor, and I was wondering if it’s possible to render a RadzenPieSeries using the HtmlRenderer.

I understand that Radzen components require @rendermode="InteractiveServer" for interactivity, which seems to contradict the StaticHtmlRenderer approach.

Are there any workarounds to make this work, or perhaps plans for future development that would allow rendering RadzenPieSeries (or similar components) in static mode while maintaining functionality?

Any insights or guidance would be greatly appreciated!

Thanks in advance!

You should be able to render the chart in static rendering mode. What did you try? It won't be interactive of course but it should render just fine as long as you set its width and height. Here is what I tested with:

<RadzenChart style="width: 700px;height:500px;">
    <RadzenPieSeries Data="@items" CategoryProperty="Name" ValueProperty="Age" />
</RadzenChart>

@code {
    class DataItem
    {
        public string Name { get; set; }
        public int Age { get; set; }
    }

    private List<DataItem> items = new List<DataItem>
    {
        new DataItem { Name = "John Doe", Age = 30 },
        new DataItem { Name = "Jane Doe", Age = 25 },
        new DataItem { Name = "Sammy Doe", Age = 10 },
    };
}

We don't plan to provide all features in static rendering mode as this would require implementing them again in JavaScript. To us this completely defeats the purpose of Blazor.

You are awesome, the problem was with the missing width and height:

image