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
["John", 10000],
6
["Jake", 12000],
7
["Peter", 13000],
8
["James", 10000],
9
["Mary", 9000]
10
]);
11
12
// set the chart type
13
var chart = anychart.line();
14
15
// create a series, set the data and name
16
var series = chart.column(data);
17
series.name("Sales");
18
19
// enable and configure labels on the series
20
series.labels(true);
21
series.labels().fontColor("green");
22
series.labels().fontWeight(900);
23
series.labels().format("${%value}");
24
25
// set the chart title
26
chart.title("Labels (Series)");
27
28
// set the titles of the axes
29
var xAxis = chart.xAxis();
30
xAxis.title("Manager");
31
var yAxis = chart.yAxis();
32
yAxis.title("Sales, $");
33
34
// set the container id
35
chart.container("container");
36
37
// initiate drawing the chart
38
chart.draw();
39
});