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", value: 0.10},
6
{x: "1996", value: 0.10},
7
{x: "1997", value: 0.12},
8
{x: "1998", value: 0.13},
9
{x: "1999", value: 0.15},
10
{x: "2000", value: 0.15},
11
{x: "2001", value: 0.15},
12
{x: "2002", value: 0.19},
13
{x: "2003", value: 0.20}
14
];
15
16
// create a chart
17
var chart = anychart.area();
18
19
// create a step area series and set the data
20
var series = chart.stepArea(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("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("Rate");
36
37
// set the container id
38
chart.container("container");
39
40
// initiate drawing the chart
41
chart.draw();
42
});