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
{x: "John", value: 10000},
6
{x: "Jake", value: 12000},
7
{x: "Peter", value: 13000,
8
normal: {
9
fill: "#5cd65c",
10
stroke: null,
11
label: {enabled: true}
12
},
13
hovered: {
14
fill: "#5cd65c",
15
stroke: null,
16
label: {enabled: true}
17
},
18
selected: {
19
fill: "#5cd65c",
20
stroke: null,
21
label: {enabled: true}
22
}
23
},
24
{x: "James", value: 10000},
25
{x: "Mary", value: 9000}
26
];
27
28
// create a chart
29
var chart = anychart.bar();
30
31
// create a bar series and set the data
32
var series = chart.bar(data);
33
34
// set the chart title
35
chart.title("Bar Chart: Appearance (Individual Points)");
36
37
// set the titles of the axes
38
chart.xAxis().title("Manager");
39
chart.yAxis().title("Sales, $");
40
41
// set the container id
42
chart.container("container");
43
44
// initiate drawing the chart
45
chart.draw();
46
});