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 a data set
4
var data = anychart.data.set([
5
["January", 10000, 12500],
6
["February", 12000, 15000],
7
["March", 13000, 16500],
8
["April", 10000, 13000],
9
["May", 9000, 11000]
10
]);
11
12
// map the data
13
var seriesData_1 = data.mapAs({x: [0], value: [1]});
14
var seriesData_2 = data.mapAs({x: [0], value: [2]});
15
16
// create a chart
17
var chart = anychart.column();
18
19
// create the first series and set the data
20
var series1 = chart.column(seriesData_1);
21
22
// create the second series and set the data
23
var series2 = chart.column(seriesData_2);
24
25
// create error bars on the first series
26
series1.error().valueError(400);
27
28
// create error bars on the second series
29
series2.error().valueLowerError(700);
30
series2.error().valueUpperError(200);
31
32
// set the chart title
33
chart.title("Lower and Upper Error Bars: Cartesian");
34
35
// set the container id
36
chart.container("container");
37
38
// initiate drawing the chart
39
chart.draw();
40
});