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

DxChartSeries.Visible Property

Specifies the series visibility.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(true)]
[Parameter]
public bool Visible { get; set; }

#Property Value

Type Default Description
Boolean true

true to display the series; otherwise, false.

#Remarks

Set the Visible option to false to hide the series.

Razor
<DxChart Data="@ChartsData">
    <DxChartLineSeries Name="2017" 
                       Visible=false 
                       Filter="@((SaleInfo s) => s.Date.Year == 2017)" 
                       ArgumentField="@(s => s.City)" 
                       ValueField="@(s => s.Amount)" 
                       SummaryMethod="Enumerable.Sum" />
    <DxChartLineSeries Name="2018" 
                       Filter="@((SaleInfo s) => s.Date.Year == 2018)"
                       ArgumentField="@(s => s.City)" 
                       ValueField="@(s => s.Amount)" 
                       SummaryMethod="Enumerable.Sum" />
    <DxChartLineSeries Name="2019" 
                       Filter="@((SaleInfo s) => s.Date.Year == 2019)"
                       ArgumentField="@(s => s.City)" 
                       ValueField="@(s => s.Amount)" 
                       SummaryMethod="Enumerable.Sum" />
    <DxChartLegend Position="RelativePosition.Outside" HorizontalAlignment="HorizontalAlignment.Right" />
</DxChart>

If the AllowToggleSeries property is set to true, the series legend item displays a checkbox that allows users to hide and show the series. Otherwise, the legend item of a hidden series is disabled.

Run Demo: Charts - Legend Customization

See Also