Skip to main content

Series3DBase.Legend Property

Gets or sets a legend displaying the legend item of the series.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.1.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public Legend Legend { get; set; }

Property Value

Type Description
Legend

The legend displaying the series item.

Example

This example illustrates how to assign legends to a Series3D:

Binding Sample

Important

The series can use only legends that the Chart3DControl stores in the legend collection. Do not assign new legends to series properties.

<dxc:Chart3DControl>
    <dxc:Chart3DControl.DataContext>
        <local:SalesChartViewModel/>
    </dxc:Chart3DControl.DataContext>
    <dxc:Chart3DControl.XAxis>
        <dxc:XAxis3D>
            <dxc:XAxis3D.NumericScaleOptions>
                <dxc:ManualNumericScaleOptions/>
            </dxc:XAxis3D.NumericScaleOptions>
        </dxc:XAxis3D>
    </dxc:Chart3DControl.XAxis>
    <dxc:Chart3DControl.Legends>
        <dxc:Legend x:Name="legend"
                    HorizontalPosition="RightOutside"
                    VerticalPosition="Top">
            <dxc:Legend.Title>
                <dxc:LegendTitle Content="DevAV Sales"/>
            </dxc:Legend.Title>
        </dxc:Legend>
    </dxc:Chart3DControl.Legends>
    <dxc:Chart3DControl.SeriesSource>
        <dxc:Series3DStorage>
            <dxc:Series3D DisplayName="Manhattan Bars"
                          Legend="{Binding ElementName=legend}">
                <dxc:Series3D.PointSource>
                            <dxc:SeriesPoint3DDataSourceAdapter DataSource="{Binding SaleData}" 
                                                                XArgumentDataMember="Year"
                                                                YArgumentDataMember="Region" 
                                                                ValueDataMember="Value"/>
                        </dxc:Series3D.PointSource>
                <dxc:Series3D.View>
                    <dxc:Bar3DSeriesView>
                        <dxc:Bar3DSeriesView.Colorizer>
                            <dxc:KeyColorColorizer3D>
                                <dxc:KeyColorColorizer3D.KeyProvider>
                                    <dxc:XArgumentKeyProvider3D/>
                                </dxc:KeyColorColorizer3D.KeyProvider>
                            </dxc:KeyColorColorizer3D>
                        </dxc:Bar3DSeriesView.Colorizer>
                    </dxc:Bar3DSeriesView>
                </dxc:Series3D.View>
            </dxc:Series3D>
        </dxc:Series3DStorage>
    </dxc:Chart3DControl.SeriesSource>
</dxc:Chart3DControl>

The following properties allow you to configure chart elements to series binding:

Symbol Description
Series3DBase.Legend Gets or sets a legend displaying the legend item of the series.
Legend Represents a chart control’s legend.
ChartControlBase.Legends Returns the collection of chart legends.
See Also