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
["John", 10000],
6
["Jake", 12000],
7
["Peter", 13000],
8
["James", 10000],
9
["Mary", 9000]
10
];
11
12
// create a chart
13
var chart = anychart.column();
14
15
// create a column series and set the data
16
var series = chart.column(data);
17
series.name('Requirements Complete');
18
19
// set the chart title
20
chart.title("Column Chart: Basic Sample");
21
22
// set the titles of the axes
23
chart.xAxis().title("Manager");
24
chart.yAxis().title("Sales, $");
25
26
// set the container id
27
chart.container("container");
28
29
// initiate drawing the chart
30
chart.draw();
31
32
series.listen("pointClick", function (e) {
33
console.log(e.iterator.get("value"));
34
console.log(e.iterator.get("x"));
35
console.log(e.series.name());
36
});
37
});