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
// set chart type
4
var chart = anychart.column();
5
6
// adjust chart settings
7
var title = chart.title();
8
// enable title
9
title.enabled(true);
10
// set title text
11
title.text("Sales Performance");
12
// place title into bottom of the chart
13
title.orientation("bottom");
14
// stick title to the left side
15
title.align("left");
16
17
// data
18
var data = anychart.data.set([
19
["John", 10000],
20
["Jake", 12000],
21
["Peter", 18000],
22
["James", 11000],
23
["Mary", 9000]
24
]);
25
26
// set data
27
var series = chart.column(data);
28
series.name("Sales");
29
30
// draw chart
31
chart.container("container");
32
chart.draw();
33
});