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 the data
4
var data = {
5
header: ["Country", "Number of cases"],
6
rows: [
7
["United States", 337072],
8
["Spain", 131646],
9
["Italy", 128948],
10
["Germany", 100123],
11
["France", 93773],
12
["China", 82602],
13
["Iran", 58226],
14
["United Kingdom", 48436],
15
["Turkey", 27069],
16
["Switzerland", 21100]
17
]};
18
19
// create the column chart
20
var chart = anychart.column();
21
22
// add the data
23
chart.data(data);
24
25
// set the chart title
26
chart.title("Top 10 Countries with the Most Cases of COVID-19");
27
28
// set the container
29
chart.container("container");
30
31
// draw the chart
32
chart.draw();
33
34
});