Skip to main content

DxChartBase.RedrawAsync() Method

Re-renders the chart component and its child components.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor


public Task RedrawAsync()


Type Description

The task that is completed when the chart is redrawn.


The chart component redraws itself automatically when:

To force the chart to re-render the component, call the RedrawAsync method.

In the snippet below, the chart component is in the hidden <div> element. The chart is re-rendered when its parent container becomes visible.

    .hidden {
        display: none;

    .visible {
        display: block;

<DxButton Text="Make Visble" Click="MakeDivVisible" />

<div class="@divClass">
    <DxPieChart Data="forecasts" @ref="Chart">
        <DxPieChartSeries ArgumentField="@((WeatherForecast i) => i.Date)"
                          ValueField="@((WeatherForecast i) => i.Precipitation)"
        <DxChartLegend Visible="false" />

@code {
    DxPieChart<WeatherForecast> Chart;
    string divClass = "hidden";
    bool NeedsRedraw;
    void MakeDivVisible()
        divClass = "visible";
        NeedsRedraw = true;
    protected override async Task OnAfterRenderAsync(bool firstRender)
        if (NeedsRedraw)
            await Chart.RedrawAsync();
        NeedsRedraw = false;
    protected override void OnInitialized()
        forecasts = GetForecast();

To update the chart when its data source collection changes, use the RefreshData method.

See Also