HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function() {
2
3
// create data
4
var data = [
5
{x: "1995", low: 0.10, high: 0.15},
6
{x: "1996", low: 0.10, high: 0.15},
7
{x: "1997", low: 0.12, high: 0.17},
8
{x: "1998", low: 0.13, high: 0.20},
9
{x: "1999", low: 0.15, high: 0.20},
10
{x: "2000", low: 0.15, high: 0.22},
11
{x: "2001", low: 0.15, high: 0.22},
12
{x: "2002", low: 0.19, high: 0.23},
13
{x: "2003", low: 0.20, high: 0.23}
14
];
15
16
// create a chart
17
var chart = anychart.area();
18
19
// create a range step area series and set the data
20
var series = chart.rangeStepArea(data);
21
22
// set step direction to the forward mode
23
series.stepDirection("forward");
24
25
// enable markers
26
series.markers(true);
27
28
// set the chart title
29
chart.title("Range Step Area Chart. Step Direction: Forward");
30
31
// set the titles of the axes
32
var xAxis = chart.xAxis();
33
xAxis.title("Year");
34
var yAxis = chart.yAxis();
35
yAxis.title("Min and Max Rate");
36
37
// set the container id
38
chart.container("container");
39
40
// initiate drawing the chart
41
chart.draw();
42
});