Range Area Series
Overview
The Range Area charts displays a range of data by plotting two Y values per data point. Each Y value
used is drawn as the upper, and lower bounds of an area.
Some data may look very nice and are
easily understood in this form, in which an area spans a region from a minimum value to a maximum value.
Adding Series
Data-Provider
Before you can add series to the chart you need to prepare Data Provider. You need two fields to
create Range Area chart: High and Low. So the Data Provider should contain both fields.
Sample XML for Range Area Data Provider:
As you can see both fields are defined: High and Low. Now you
can declare series that will use this Data Provider.
Series Declaration
XML syntax to declare series with Data Provider shown above:
04 |
< name > <![CDATA[ High/Low Temp. (C) ]]> </ name > |
07 | name: "High/Low Temp. (C)" |
Let's put this together and create the very basic Range Area sample:
Live Sample: Range Area Series
To learn more about common series settings see Common Series Settings
tutorial.
Configuring visualization
All visual and specific settings for Range Area series are set in <range_area_series>
in <series> node.
You can change the upper and lower border of the area in <high> and <low> nodes and area fill in <fill>
subnode of <range_area_series> node.
Sample XML with fill and line colors defined:
02 |
< name > <![CDATA[ High/Low Temp. (C) ]]> </ name > |
05 | name: "High/Low Temp. (C)" , |
14 | color: "DarkColor(%Color)" , |
22 | color: "DarkColor(%Color)" , |
Live Sample below shows Range Area with configured visualization:
Live Sample: Range Area Series Visual Settings
Markers
Two markers instead of one can be added to Range Area series: one for high value, another - for low. There are
special <high> and <low> nodes for that.
Sample XML with marker settings:
To learn more about marker settings see Series Common Settings article.
Live Sample:
Live Sample: Range Area Series Marker Settings
Legend Element
For each series you can define its element in legend. This element contains the settings for the formatting string of the text in legend that represents the series. Configuration of such elements is described in Legend: Series Labels article.
Tooltips
You can either use global tooltip settings or create personal tooltips for each series. See detailed description in Tooltips tutorial.
Choosing Field for Comparison Mode
When you use Range Area series in comparison mode (when Value axis is set to "Changes" or
"PercentChanges") - you need to define comparison field.
XML for comparison mode field selection:
As you can see comparison field is set in compare_field_type attribute, which can:
High or Low. By default it is Low.
Live sample below shows Range Area and Spline series on one
chart in Comparison mode with comparison field set to Comparison High:
Live Sample: RangeArea Series - Comparision Field Settings
Defaults Section
There is a special section to set default values in AnyChart Stock component XML:
<series_settings>, where you can define marker and value highlighter settings for all
series of the given type in one place, instead of setting them for each series individually.
For example, to configure bounds and fill in one chart for all series of RangeArea type just set:
11 | color: "DarkColor(%Color)" , |
19 | color: "DarkColor(%Color)" , |
Live sample below has two series of Range Area type. All common settings defined in <range_area_series/> node :
Live Sample: Range Area Series - Using Defaults Section