Back to Devexpress

RangeColorizer3D.ValueProvider Property

wpf-devexpress-dot-xpf-dot-charts-dot-rangecolorizer3d-be06b3ca.md

latest5.6 KB
Original Source

RangeColorizer3D.ValueProvider Property

Gets or sets the provider that specifies a point value the colorizer should use to define the point color.

Namespace : DevExpress.Xpf.Charts

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

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public IColorizer3DValueProvider ValueProvider { get; set; }
vb
Public Property ValueProvider As IColorizer3DValueProvider

Property Value

TypeDescription
IColorizer3DValueProvider

The value provider.

|

Remarks

Example 1

This example shows how to use the ColorObjectValueProvider3D class to make the colorizer utilize values that the ColorDataMember property provides.

View Example

xaml
<dxc:Series3D DisplayName="Series 1">
    <dxc:Series3D.View>
        <dxc:Point3DSeriesView>
            <dxc:Point3DSeriesView.MarkerModel>
                <dxc:Marker3DSpherePointModel SphereDetalizationLevel="Low"/>
            </dxc:Point3DSeriesView.MarkerModel>
            <dxc:Point3DSeriesView.Colorizer>
                <dxc:RangeColorizer3D RangeStops="-0.4 0.4 1.8 2" 
                                      ApproximateColors="True">
                    <dxc:RangeColorizer3D.ValueProvider>
                        <dxc:ColorObjectValueProvider3D/>
                    </dxc:RangeColorizer3D.ValueProvider>
                    <dxc:RangeColorizer3D.Palette>
                        <dxc:YellowPalette/>
                    </dxc:RangeColorizer3D.Palette>
                </dxc:RangeColorizer3D>
            </dxc:Point3DSeriesView.Colorizer>
        </dxc:Point3DSeriesView>
    </dxc:Series3D.View>
    <dxc:SeriesPoint3DDataSourceAdapter DataSource="{Binding Stars}" 
                                        XArgumentDataMember="X" 
                                        YArgumentDataMember="Y"
                                        ValueDataMember="Z" 
                                        ColorDataMember="ColorIndex"/>
</dxc:Series3D>

Example 2

The following example shows how to calculate point colors based on point x-arguments.

Markup

xaml
<dxc:Series3D DisplayName="Series 1">
    <dxc:Series3D.View>
        <dxc:Point3DSeriesView>
            <dxc:Point3DSeriesView.MarkerModel>
                <dxc:Marker3DSpherePointModel SphereDetalizationLevel="Low"/>
            </dxc:Point3DSeriesView.MarkerModel>
            <dxc:Point3DSeriesView.Colorizer>
                <dxc:RangeColorizer3D RangeStops="-90000 -60000 -30000 0 30000 60000 90000"
                                      ApproximateColors="True">
                    <dxc:RangeColorizer3D.ValueProvider>
                        <local:ColorizerValueProvider/>
                    </dxc:RangeColorizer3D.ValueProvider>
                    <dxc:RangeColorizer3D.Palette>
                        <dxc:YellowPalette/>
                    </dxc:RangeColorizer3D.Palette>
                </dxc:RangeColorizer3D>
            </dxc:Point3DSeriesView.Colorizer>
        </dxc:Point3DSeriesView>
    </dxc:Series3D.View>
    <dxc:SeriesPoint3DDataSourceAdapter DataSource="{Binding Stars}" 
                                        XArgumentDataMember="X" 
                                        YArgumentDataMember="Y"
                                        ValueDataMember="Z"/>
</dxc:Series3D>

Code-Behind

csharp
using DevExpress.Xpf.Charts;
using System;
using System.Windows;

namespace GettingStarted2 {
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
        }
    }
    public class ColorizerValueProvider : IColorizer3DValueProvider {
        public double GetValue(object argumentX, object argumentY, double[] values, object color) {
            return Convert.ToDouble(argumentX);
        }
    }
}
vb
Imports DevExpress.Xpf.Charts
Imports System
Imports System.Windows

Namespace GettingStarted2
    Public Partial Class MainWindow
        Inherits Window

        Public Sub New()
            InitializeComponent()
        End Sub
    End Class

    Public Class ColorizerValueProvider
        Inherits IColorizer3DValueProvider

        Public Function GetValue(ByVal argumentX As Object, ByVal argumentY As Object, ByVal values As Double(), ByVal color As Object) As Double
            Return Convert.ToDouble(argumentX)
        End Function
    End Class
End Namespace

See Also

RangeColorizer3D Class

RangeColorizer3D Members

DevExpress.Xpf.Charts Namespace