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

DxChartLegend Class

Defines a chart legend.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public class DxChartLegend :
    DxComplexSettingsComponent<DxChartLegend, ChartLegendModel>,
    IModelProvider<ChartTitleModel>

#Remarks

Use DxChartLegend objects to customize legend settings for the following components:

DxChart<T>
A control that visualizes bound data as graphs: bar, area, line, and others.
DxPieChart<T>
A control that visualizes data as Pie and Donut charts.
DxPolarChart<T>
A control that visualizes bound data as graphs in polar coordinates.

A chart component can display a legend - an explanatory component that helps you identify a series. Each series is defined by an item on a legend. An item marker identifies the series color. An item label displays the series title.

Charts Legend

Use DxChartLegend class properties to specify legend settings.

Razor
<DxChart Data="@SalesData">
    @* ... *@
    <DxChartLegend AllowToggleSeries="true" 
                   Orientation="Orientation.Vertical" 
                   HorizontalAlignment="HorizontalAlignment.Right">
        <DxChartTitle Text="Years">
            <DxChartSubTitle Text="(2017-2019)"></DxChartSubTitle>
        </DxChartTitle>
    </DxChartLegend>
</DxChart>

Run Demo: Charts - Legend Customization

#Inheritance

Object
ComponentBase
DxSettingsComponent<DevExpress.Blazor.Internal.ChartLegendModel>
DxComplexSettingsComponent<DxChartLegend, DevExpress.Blazor.Internal.ChartLegendModel>
DxChartLegend
See Also