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.pie([
3
{x: 'Cycling', value: 10},
4
{x: 'Swimming', value: 12},
5
{x: 'Run', value: 18},
6
{x: 'Hiking', value: 11},
7
{x: 'Alpinism', value: 9}
8
]);
9
10
var legend = chart.legend();
11
12
var separator = legend.titleSeparator();
13
separator.enabled(true);
14
separator.height('30%');
15
16
// Set the separator fill.
17
separator.fill(
18
{
19
src: 'https://static.anychart.com/images/beach.png',
20
mode: 'stretch'
21
}
22
);
23
24
chart.title('Set the separator fill as an image');
25
chart.container('container');
26
chart.draw();
27
});