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
var chart = anychart.column([
4
{x: "Waffle Bowl", value: 1000},
5
{x: "Kids Cone", value: 1300},
6
{x: "Cake Cup", value: 1400},
7
{x: "Color Cup", value: 1100},
8
{x: "Jumbo Cup", value: 9000},
9
{x: "Jacketed Waffle Cone", value: 1000},
10
{x: "Sugar Cone", value: 5000}
11
]);
12
13
// create a label
14
var label = chart.label();
15
16
label.padding(10, 10);
17
label.position("right-top");
18
label.anchor("right-top");
19
label.offsetY(15);
20
label.offsetX(25);
21
label.width(200);
22
label.hAlign("center");
23
label.text("Ice cream cones types");
24
25
// another way of setting everything is JSON
26
label.background({
27
"enabled": true,
28
"fill": null,
29
"stroke": "2 gold",
30
"cornerType": "round-inner",
31
"corners": 5});
32
33
chart.container("container");
34
chart.draw();
35
});