Skip to main content

DxChartSeriesLegendItem.VisibleIndex Property

Specifies a legend item’s visible index.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

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

<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