Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxPieChartSeries<T, TArgument, TValue>.VisibleChanged Event

Fires when a pie series visibility changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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.

Razor
<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();
    }
}

See Also