DxChart<T>.RedrawAsync() Method

Re-renders the Chart and its child components.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll


public Task RedrawAsync()


Type Description

An asynchronous operation that redraws the Chart.


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">
    <DxChart Data="forecasts" @ref="Chart">
        <DxChartBarSeries ArgumentField="@((WeatherForecast i) => i.Date)"
                          ValueField="@((WeatherForecast i) => i.Precipitation)"

@code {
    DxChart<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