RangeArea Chart

RangeArea series are similar to Area series, however they are not bound to start from the zero value on the y intercept. They are useful for representing range data, such as high and low values.

rangearea

The chart from the image above is created with the following code:

<shield:ShieldChart ID="ShieldChart1" runat="server" Width="580px" Height="400px"
    OnTakeDataSource="ShieldChart1_TakeDataSource" CssClass="chart">
    <PrimaryHeader Text="Currency rates">
    </PrimaryHeader>
    <TooltipSettings>
        <AxixMarkers Enabled="true" Mode="X" Width="1" ZIndex="3"/>
    </TooltipSettings>
    <Legend Align="Center" VerticalAlign="Top">
    </Legend>
    <Axes>
        <shield:ChartAxisX AxisType="Datetime">
        </shield:ChartAxisX>
    </Axes>
    <DataSeries>
        <shield:ChartRangeAreaSeries CollectionAlias="USD/EUR low/high values" 
            DataFieldLow="low" DataFieldHigh="high">
            <Settings EnableAnimation="false">
                <Tooltip CustomPointText="Low:<b>{point.low}</b></br>High:<b>{point.high}</b>">
                </Tooltip>
            </Settings>
        </shield:ChartRangeAreaSeries>
    </DataSeries>
</shield:ShieldChart>
protected void ShieldChart1_TakeDataSource(object sender, ChartTakeDataSourceEventArgs e)
{
    ShieldChart1.DataSeries[0].DataStart = (decimal)(new DateTime(2013, 5, 5) - new DateTime(1970, 1, 1)).TotalMilliseconds;
    ShieldChart1.DataSeries[0].DataStep = 24 * 3600 * 1000;

    ShieldChart1.DataSource = new object[] 
    {                   
        new { low = 1.3147, high = 1.3254 }, 
        new { low = 1.3161, high = 1.3300 },
        new { low = 1.3262, high = 1.3416 }, 
        new { low = 1.3326, high = 1.3416 }, 
        new { low = 1.3318, high = 1.3381 }, 
        new { low = 1.3343, high = 1.3358 }, 
        new { low = 1.3296, high = 1.3374 }, 
        new { low = 1.3279, high = 1.3391 },
        new { low = 1.3267, high = 1.3359 }, 
        new { low = 1.3233, high = 1.3318 }, 
        new { low = 1.3177, high = 1.3270 }, 
        new { low = 1.3187, high = 1.3222 }, 
        new { low = 1.3193, high = 1.3285 }, 
        new { low = 1.3075, high = 1.3306 }, 
        new { low = 1.3054, high = 1.3116 }, 
        new { low = 1.3042, high = 1.3101 },
        new { low = 1.2956, high = 1.3108 }, 
        new { low = 1.2985, high = 1.3000 }, 
        new { low = 1.2945, high = 1.3049 }, 
        new { low = 1.2934, high = 1.3061 }, 
        new { low = 1.2837, high = 1.2976 }, 
        new { low = 1.2841, high = 1.2950 }, 
        new { low = 1.2915, high = 1.2949 }, 
        new { low = 1.2934, high = 1.2943 },
        new { low = 1.2905, high = 1.2994 }, 
        new { low = 1.2821, high = 1.2956 }, 
        new { low = 1.2834, high = 1.2998 }
    };
}
  • When the chart is bound to collection of objects the X values are got by the field which name is set into the DataFieldX property of the ChartRangeAreaSeries. The low and high values are got by the fields which names are set into the DataFieldLow and DataFieldHigh.
  • The name that is shown in the legend is chosen via the CollectionAlias property of the ChartRangeAreaSeries.
  • By default all X values are sorted in order rangearea chart to be shown appropriately, however this behavior is controlled by the EnableValueXSorting property of the ChartRangeAreaSeries.
  • The line type of the ChartRangeAreaSeriescan be changed by the Settings.SeriesDashStyle property and it can be set as: Solid, ShortDash, ShortDot, ShortDashDot, Dot, etc.
  • DataStart and DataStep properties control the start value of the x axis and explicit value for the interval between a data series member values.
  • All points from the ChartRangeAreaSeries are represented with ChartSeriesItem which belongs to the ChartRangeAreaSeries.Items collection.
    • The ChartRangeAreaSeries.Items can be added declarative without data binding.
    • The data binding and declarative approach can be mixed. However in order declarative items to be appended to the items created from the datasource the ShieldChart.AppendDataBoundItems property need to be set to "true".
  • All setting related to ChartRangeAreaSeries are contained into the ChartRangeAreaSeries.Settings object.
    • o The background and line color can be set via Color and InnerColor properties.
    • If the AddToLegend is set to false the series is not added into the legend.
    • The animation of the series can be controlled by ChartRangeAreaSeries.Settings.EnableAnimation and ChartRangeAreaSeries.Settings.AnimationDuration properties.
    • Each point from the series can be selected if the EnablePointSelection property is set to true.
    • All selected points can be customized by Settings.PointMark.ActiveSettings.PointSelectedState object properties.
    • From the Settings.PointMark.ActiveSettings.PointHoveredState object properties you can change the appearance of each part when the user hovers it.
    • Each series has related tooltip which can be customized via the Settings.Tooltip object.
    • Each point from the series can have related text, which appearance is controlled by Settings.DataPointText property. You can changeBackgroundColor, BorderColor, Color, Padding, and TextAngle of the corresponding data point text.