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

DxChartSeriesLegendItem.VisibleIndex Property

Specifies a legend item’s visible index.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public int VisibleIndex { get; set; }

#Property Value

Type Description
Int32

A zero-based index.

#Remarks

The Chart legend displays items in order the corresponding series are specified in the component markup. Use the VisibleIndex property to reorder series label items.

Razor
<DxChart Data="@SalesData">
    <DxChartTitle Text="Sales amount">
        <DxChartSubTitle Text="by cities" />
    </DxChartTitle>
    <DxChartBarSeries Name="2017">
        <DxChartSeriesLegendItem VisibleIndex="2" />
    </DxChartBarSeries>
    <DxChartBarSeries Name="2018">
        <DxChartSeriesLegendItem VisibleIndex="1" />
    </DxChartBarSeries>
    <DxChartLineSeries Name="2019">
        <DxChartSeriesLegendItem VisibleIndex="0"/>
    </DxChartLineSeries>
    <DxChartLegend AllowToggleSeries="true" 
                   Orientation="Orientation.Vertical" 
                   HorizontalAlignment="HorizontalAlignment.Right">
        <DxChartTitle Text="Years">
            <DxChartSubTitle Text="(2017-2019)"></DxChartSubTitle>
        </DxChartTitle>
    </DxChartLegend>
</DxChart>

Chart Legend Item Visible Index

Run Demo: Charts - Legend Customization

See Also