Skip to content

Latest commit

 

History

History

ValueRangeColorizer

Color Points by Their Values

In this example, the bar chart displays cryptocurrency portfolio yield. It colors series points red when their Y-axis values are between -100 and 0, and green when values are between 0 and 100. Note that this chart diagram is rotated.

Chart with point value ranges

Follow the steps below to create a similar chart:

  • Add a BarSeries object to the ChartView.Series collection, and specify its Data property to bind the series to a data source.

  • Assign a ValueBandPointColorizer object to the BarSeries.PointColorizer property.

  • To specify color boundaries, populate the colorizer's ColorStops collection with ColorStop objects.

    <dxc:BarSeries.PointColorizer>
        <dxc:ValueBandPointColorizer>
            <dxc:ValueBandPointColorizer.ColorStops>
                <dxc:ColorStop Color="Green" Value1="0" Value2="100"/>
                <dxc:ColorStop Color="Red" Value1="0" Value2="-100"/>
            </dxc:ValueBandPointColorizer.ColorStops>
        </dxc:ValueBandPointColorizer>
    </dxc:BarSeries.PointColorizer>

Files to Review

Documentation