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
// data
4
var data = anychart.data.set([
5
["John", 10000, 12000],
6
["Jake", 12000, 15000],
7
["Peter", 18000, 16000],
8
["James", 11000, 13000],
9
["Mary", 9000, 19000]
10
]);
11
12
// map data for the each series
13
var Sales2013 = data.mapAs({x: [0], value: [1]});
14
var Sales2014 = data.mapAs({x: [0], value: [2]});
15
16
// chart type
17
var chart = anychart.column();
18
19
// set data
20
var series2013 = chart.column(Sales2013);
21
// set series name
22
series2013.name("Sales in 2013");
23
24
// set series data
25
var series2014 = chart.column(Sales2014);
26
// set series name
27
series2014.name("Sales in 2014");
28
29
// chart title
30
chart.title("Enable the accessibility support on the chart");
31
32
// set axes titles
33
var xAxis = chart.xAxis();
34
xAxis.title("Retail Channel");
35
var yAxis = chart.yAxis();
36
yAxis.title("Sales");
37
38
// enable legend
39
chart.legend(true);
40
41
// enable the accessibility of the chart
42
chart.a11y(true);
43
44
// enable the accessibility support for series
45
series2013.a11y(true);
46
series2014.a11y(true);
47
48
// draw
49
chart.container("container");
50
chart.draw();
51
});