Back to Devexpress

GradientFillStyle.ColorStops Property

wpf-devexpress-dot-xpf-dot-charts-dot-gradientfillstyle.md

latest4.1 KB
Original Source

GradientFillStyle.ColorStops Property

Gets or sets the color stop collection of the fill style.

Namespace : DevExpress.Xpf.Charts

Assembly : DevExpress.Xpf.Charts.v25.2.dll

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public ColorStopCollection ColorStops { get; }
vb
Public ReadOnly Property ColorStops As ColorStopCollection

Property Value

TypeDescription
ColorStopCollection

The collection of the ColorStop objects.

|

Remarks

The following example specifies the color stop collection in code:

xaml
<dxc:GradientFillStyle x:Name="GradientFillStyle1" LegendTextPattern="{}{V}">
</dxc:GradientFillStyle>
csharp
GradientFillStyle1.ColorStops.Add(new ColorStop(Colors.CornflowerBlue, new Unit(0, UnitType.Percent)));
GradientFillStyle1.ColorStops.Add(new ColorStop(Colors.DarkSeaGreen, new Unit(50, UnitType.Percent)));
GradientFillStyle1.ColorStops.Add(new ColorStop(Colors.Green, new Unit(100, UnitType.Percent)));
vb
GradientFillStyle1.ColorStops.Add(New ColorStop(Colors.CornflowerBlue, New Unit(0, UnitType.Percent)))
GradientFillStyle1.ColorStops.Add(New ColorStop(Colors.DarkSeaGreen, New Unit(50, UnitType.Percent)))
GradientFillStyle1.ColorStops.Add(New ColorStop(Colors.Green, New Unit(100, UnitType.Percent)))

Example

This example demonstrates how to colorize a surface with a gradient. It uses the following classes and properties.

Class or PropertyDescription
Series3DBase.ViewThe view of the series.
SurfaceSeriesViewThe Surface series view.
SurfaceSeriesView.FillStyleThe fill style of the front side of a surface.
GradientFillStyleThe fill style that used the gradient to colorize a surface.
GradientFillStyle.ColorStopsThe collection of color stops defining a gradent.
ColorStopDescribes the location and color of a transition point in a gradient.
xaml
<dxc:Series3DStorage>
    <dxc:Series3D DisplayName="Height Map">
        <dxc:SeriesPoint3DMatrixAdapter XArguments="{Binding ImageData.XArguments}" 
                                        YArguments="{Binding ImageData.YArguments}" 
                                        Values="{Binding ImageData.Values}"/>
        <dxc:Series3D.View>
            <dxc:SurfaceSeriesView>
                <dxc:SurfaceSeriesView.FillStyle>
                    <dxc:GradientFillStyle LegendTextPattern="{}{V}">
                        <dxc:GradientFillStyle.ColorStops>
                            <dxc:ColorStop Color="#FF4472C4" Offset="0%"/>
                            <dxc:ColorStop Color="#FF5B9BD5" Offset="25%"/>
                            <dxc:ColorStop Color="#FF70AD47" Offset="50%"/>
                            <dxc:ColorStop Color="#FFFFC000" Offset="75%"/>
                            <dxc:ColorStop Color="#FFED7D31" Offset="100%"/>
                        </dxc:GradientFillStyle.ColorStops>
                    </dxc:GradientFillStyle>
                </dxc:SurfaceSeriesView.FillStyle>
            </dxc:SurfaceSeriesView>
        </dxc:Series3D.View>
    </dxc:Series3D>
</dxc:Series3DStorage>

See Also

GradientFillStyle Class

GradientFillStyle Members

DevExpress.Xpf.Charts Namespace