RangeBarSeries Class

Displays data as bars grouped by arguments. Each bar shows the range between two data values for each argument value.

Namespace: DevExpress.XamarinForms.Charts

Assembly: DevExpress.XamarinForms.Charts.dll


public class RangeBarSeries :


Use this series type to show the difference between the minimum and maximum values (for example, high and low temperatures, stock prices, blood pressure readings, etc.) in each corresponding point (for example, over a unit of time).

Range Bar Series

Series Data

To bind a range bar series to data, set the RangeBarSeries.Data property to the SeriesDataAdapter class instance. Use the adapter's properties to specify the data source for the series and to define the data source members used to generate series points and labels. This series type requires one argument and two values (Value1 and Value2) for a data point.

                <dxc:SeriesDataAdapter DataSource="{Binding OilPrices}" ArgumentDataMember="Month">
                    <dxc:ValueDataMember Type="Value1" Member="HighValue" />
                    <dxc:ValueDataMember Type="Value2" Member="LowValue" />
        <dxc:NumericAxisY AlwaysShowZeroLevel="False">
                <dxc:NumericRange Min="50" Max="65"/>
                <dxc:AxisTitle Text="$/Barrel" Alignment="Outside"/>
        <dxc:DateTimeAxisX MeasureUnit="Month">
                <dxc:AxisLabel TextFormat="MMMM"/>
                <dxc:DateTimeRange VisualMin="01/01/2019" VisualMax="07/01/2019"/>
Show View Model
public class MainViewModel {
   public List<RangeBarDataItem> OilPrices { get; }

   public MainViewModel() {
       OilPrices = new List<RangeBarDataItem> {
           new RangeBarDataItem(new DateTime(2019, 1, 1), 55.26, 51.59),
           new RangeBarDataItem(new DateTime(2019, 2, 1), 57.26, 52.72),
           new RangeBarDataItem(new DateTime(2019, 3, 1), 60.14, 56.07),
           new RangeBarDataItem(new DateTime(2019, 4, 1), 64.04, 61.94),
           new RangeBarDataItem(new DateTime(2019, 5, 1), 62.82, 53.50),
           new RangeBarDataItem(new DateTime(2019, 6, 1), 58.47, 52.51),
           new RangeBarDataItem(new DateTime(2019, 7, 1), 60.21, 55.71),
           new RangeBarDataItem(new DateTime(2019, 8, 1), 55.10, 54.17),
           new RangeBarDataItem(new DateTime(2019, 9, 1), 58.09, 52.81),
           new RangeBarDataItem(new DateTime(2019, 10, 1), 56.66, 53.82),
           new RangeBarDataItem(new DateTime(2019, 11, 1), 58.11, 57.24),
           new RangeBarDataItem(new DateTime(2019, 12, 1), 60.20, 59.20)

public class RangeBarDataItem {
   public DateTime Month { get; }
   public double HighValue { get; }
   public double LowValue { get; }

   public RangeBarDataItem(DateTime month, double highValue, double lowValue){
       Month = month;
       HighValue = highValue;
       LowValue = lowValue;

Range Bar Series Data


ChartView chooses the X-axis type depending on data in the first series. If you need to explicitly specify the argument axis type for the chart or an individual series, use the ChartView.AxisX or Series.AxisX property. The assigned object should be compatible with the series data type. Otherwise, the chart does not display the series.

You can also create a custom data adapter, for example, to generate series points on the fly without a separate data storage.

Series Labels

You can add labels to data point markers to show point values as text on a chart.

Range Bar Series Labels

To enable labels for a range bar series, set the RangeBarSeries.Label property to the RangeBarSeriesLabel object, and use this object's properties to change the label settings:

  • TextPattern - Formats series label text.
  • Kind - Specifies which range bar values (minimum, maximum, or both) labels should display.
  • Position, Indent - Specify how labels are positioned relative to bars.
  • Style - Provides access to the SeriesLabelStyle object that stores label appearance settings (TextStyle).
  • Visible - Allows you to show or hide labels for the series.
        <dxc:RangeBarSeriesLabel TextPattern="{}{V$0.#}"
                        <dxc:TextStyle Color="DarkBlue" Size="8"/>


A legend (ChartBaseView.Legend) shows which color corresponds to which series.

Range Bar Series Legend

If the ColorEach property is enabled, a legend displays series points.

A legend item includes a color marker and text that explains the series or series point data. The default item text is the series' DisplayName (if the item displays the entire series) or a range bar's maximum and minimum values (if the item displays a series point).

The series' LegendTextPattern property allows you to configure the legend item string.

        <dxc:RangeBarSeries DisplayName="Crude Oil" 
                            LegendTextPattern="{}{S} ($/Barrel)">
        <dxc:RangeBarSeries DisplayName="Natural Gas" 
                            LegendTextPattern="{}{S} ($/MMBtu)">
        <dxc:Legend HorizontalPosition="Left"

To exclude a particular series from the legend, set that series' VisibleInLegend property to false.


ChartView can display hints (ChartView.Hint) as tooltips or as a crosshair cursor to show information about a tapped series or data point. Use the Series.HintOptions property to specify which data the series should use for a hint.


This example demonstrates how to set up the chart so that it shows a tooltip for a series point when a user taps it, and configure a tooltip for each series on the chart.

Range Bar Series Tooltips

  1. Set the chart hint's Behavior property to the TooltipHintBehavior class instance.
  2. Set each series' HintOptions property to the SeriesHintOptions object and use the PointTextPattern property to specify the tooltip text pattern.
        PointTextPattern="{}{S}:&#10;Max price:{H$0.##} &#10;Min price:{L$0.##}"/>

                <dxc:TooltipHintBehavior ShowPointTooltip="True" ShowSeriesTooltip="False"/>

        <dxc:RangeBarSeries HintOptions="{StaticResource barSeriesHintOptions}">
            <!--Series Data-->
        <dxc:RangeBarSeries HintOptions="{StaticResource barSeriesHintOptions}">
            <!--Series Data-->

Crosshair Cursor

This example demonstrates how to set up the chart so that it shows a series point hint as a crosshair cursor, and how to specify the hint's content, data format, and visibility options. The crosshair cursor appears on a long tap.

Range Bar Series Crosshair

  1. Set the chart hint's Behavior property to the CrosshairHintBehavior class instance.
  2. Set each series' HintOptions property to the SeriesCrosshairOptions object and specify this object's properties:
    • ShowInLabel - to specify whether the crosshair label should display information for points of the series.
    • PointTextPattern - to define the text pattern to show information about the series point within a crosshair label.
    • AxisLineVisible, AxisLabelVisible - to specify whether the crosshair cursor should display axis lines and labels for the series.
        PointTextPattern="{}{S}:&#10;Max price:{HV$0.##} &#10;Min price:{LV$0.##}"

                <dxc:CrosshairHintBehavior GroupHeaderTextPattern="{}{A}"/>

        <dxc:RangeBarSeries HintOptions="{StaticResource barSeriesHintOptions}">
            <!--Series Data-->
        <dxc:RangeBarSeries HintOptions="{StaticResource barSeriesHintOptions}">
            <!--Series Data-->

A crosshair cursor also gets data from axes. Use the AxisBase.HintOptions property to specify how the hint interacts with the axis.

Text Patterns

Use text patterns to customize text in a chart's labels, legend and hints. The pattern includes regular text (which is displayed as is) and placeholder strings enclosed in braces.




Displays a series name.


Displays a series point argument.


Displays a series point value.


Displays a series point max value.


Displays a series point min value.


Displays the difference between the min and max values of a series point.


To format these values, you can use default format strings after the $ sign.
For example, in the {V$#.##} string, V is a placeholder, $ is a format string separator, and #.## is a format string.

Series Appearance

To change the range bar series appearance, set the RangeBarSeries.Style property to the BarSeriesStyle object with the specified bar appearance settings (bar color and stroke).

Range Series Appearance

        <dxc:BarSeriesStyle Fill="MediumSeaGreen" Stroke="SeaGreen" StrokeThickness="10"/>


See Also