HTMLcopy
1
<div id="container"></div>
CSScopy
8
1
html,
2
body,
3
#container {
4
width: 100%;
5
height: 100%;
6
margin: 0;
7
padding: 0;
8
}
JavaScriptcopy
x
1
anychart.onDocumentReady(function () {
2
// create polar chart
3
var chart = anychart.polar();
4
5
var columnSeries = chart.column([
6
{ x: 'Rouge', value: 80540 },
7
{ x: 'Foundation', value: 94190 },
8
{ x: 'Mascara', value: 102610 },
9
{ x: 'Lip gloss', value: 110430 },
10
{ x: 'Lipstick', value: 128000 },
11
{ x: 'Nail polish', value: 143760 },
12
{ x: 'Eyebrow pencil', value: 170670 },
13
{ x: 'Eyeliner', value: 213210 },
14
{ x: 'Eyeshadows', value: 249980 }
15
]);
16
17
// set series name
18
columnSeries.name('Nevada');
19
20
// set title settings
21
chart
22
.title()
23
.enabled(true)
24
.text('Cosmetic Products by Revenue')
25
.padding({ bottom: 20 });
26
27
// disable y-axis
28
chart.yAxis(false);
29
30
// set value prefix for tooltip
31
chart.tooltip().valuePrefix('$');
32
33
// set x-scale
34
chart.xScale('ordinal');
35
36
// set chart container id
37
chart.container('container');
38
39
// initiate chart drawing
40
chart.draw();
41
});