Skip to main content

DxPieChartSeries<T, TArgument, TValue>.VisibleChanged Event

Fires when a pie series visibility changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback<bool> VisibleChanged { get; set; }

Parameters

Type Description
Boolean

A new value of the Visible property.

Remarks

Handle the VisibleChanged event to respond to the Visible property change.

<DxButton Click="@ButtonClickHandler">Change Series Visibility</DxButton>

<DxPieChart Data="@SalesData">
    <DxPieChartSeries T="SaleInfo"
                      TArgument="string"
                      TValue="double"
                      ValueField="si => si.Amount"
                      ArgumentField="si => si.Region"
                      SummaryMethod="Enumerable.Sum"
                      Visible="@IsVisible"
                      VisibleChanged="@VisibleChangedHandler">
    </DxPieChartSeries>
    <DxChartLegend Visible="false" />
</DxPieChart>

<p>Number of VisibleChangedHandler calls: @count; 
Current Series Visibility: @IsVisible</p>

@code {
  IEnumerable<SaleInfo> SalesData;
  int count = 0;
  bool IsVisible = true;
  void VisibleChangedHandler () {
        count++;
    }
    void ButtonClickHandler () {
        IsVisible = !IsVisible;
    }
    protected override async Task OnInitializedAsync() {
        SalesData = await Sales.GetSalesAsync();
        ChartsData = await DataProvider.QueryData();
        forecasts = GetForecast();
    }
}

Pie Series Visibility Changes

See Also