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.sparkline([1, 4, 7, 1]);
3
4
chart.seriesType('column');
5
6
// Set image fill.
7
chart.fill({
8
src: 'https://static.anychart.com/images/underwater.jpg',
9
mode: 'stretch',
10
opacity: 0.3
11
});
12
13
chart.title({text: 'Set image fill', orientation: 'top'});
14
chart.container('container');
15
chart.draw();
16
});