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
var chart = anychart.cartesian();
3
4
var series = chart.bar([
5
{x: 'Cycling', value: 2},
6
{x: 'Running', value: 5},
7
{x: 'Swimming', value: 3},
8
{x: 'Triathlon', value: 9},
9
{x: 'Outdoor', value: 4}
10
]);
11
12
// Get labels.
13
var labels = series.labels();
14
15
labels.enabled(true);
16
labels.fontColor('#F44336');
17
labels.fontSize(16);
18
labels.fontWeight('bold');
19
20
chart.title('Get and modify labels');
21
chart.container('container');
22
chart.draw();
23
});