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: { fill: "#5cd65c",
9
stroke: "#5cd65c"
10
},
11
hovered: { hatchFill: "forward-diagonal",
12
marker: { enabled: true,
13
size: 20,
14
type: "star5",
15
fill: "gold"
16
}
17
},
18
selected: { hatchFill: "forward-diagonal",
19
marker: { enabled: true,
20
size: 20,
21
type: "star5",
22
fill: "gold"
23
}
24
}
25
},
26
{x: "James", value: 10000},
27
{x: "Mary", value: 9000}
28
];
29
30
// create a chart
31
var chart = anychart.column();
32
33
// create a column series and set the data
34
var series = chart.column(data);
35
36
// set the chart title
37
chart.title("States: Points (Object Notation)");
38
39
// set the container id
40
chart.container("container");
41
42
// initiate drawing the chart
43
chart.draw();
44
});