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
// create column chart
3
var chart = anychart.column3d();
4
5
// turn on chart animation
6
chart.animation(true);
7
8
// set chart title text settings
9
chart.title('Top 10 Cosmetic Products by Revenue');
10
11
// create area series with passed data
12
chart.column([
13
['Driving', '15'],
14
['Transit', '39'],
15
['Walking', '40'],
16
['Cycling', '4'],
17
]);
18
19
chart.tooltip()
20
.position('center-top')
21
.anchor('center-bottom')
22
.offsetX(0)
23
.offsetY(5)
24
.format('${%Value}');
25
26
// set scale minimum
27
chart.yScale().minimum(0);
28
29
// set yAxis labels formatter
30
chart.yAxis().labels().format('{%Value}{groupsSeparator: }');
31
32
chart.tooltip().positionMode('point');
33
chart.interactivity().hoverMode('by-x');
34
35
chart.xAxis().title('');
36
chart.yAxis().title('');
37
38
// set container id for the chart
39
chart.container('container');
40
41
// initiate chart drawing
42
chart.draw();
43
});