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 Sales2003 = data.mapAs({x: 0, value: 1});
14
var Sales2004 = data.mapAs({x: 0, value: 2});
15
16
// chart type
17
var chart = anychart.column();
18
19
// switching the select mode to multi
20
var interactivity = chart.interactivity();
21
interactivity.selectionMode("multi-select");
22
23
// set data
24
var series_1 = chart.column(Sales2003);
25
series_1.name("Sales in 2013");
26
series_1.xPointPosition(0.5);
27
28
var series_2 = chart.column(Sales2004);
29
series_2.name("Sales in 2014");
30
31
series_1.fill("#E0F08F");
32
series_2.fill("#29ADC2");
33
series_1.selected().hatchFill("vertical-brick");
34
series_2.selected().hatchFill("vertical-brick");
35
series_1.stroke("none");
36
series_2.stroke("none");
37
38
// chart title
39
chart.title("Multi-select");
40
41
chart.xAxis().title("Retail Channel");
42
chart.yAxis().title("Sales");
43
44
// enable legend
45
chart.legend(true);
46
47
// draw
48
chart.container("container");
49
chart.draw();
50
});