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.line([
3
{x: 'Meat', value: 10},
4
{x: 'Fruit', value: 12},
5
{x: 'Nuts', value: 18},
6
{x: 'Milk', value: 11},
7
{x: 'Fish', value: 9}
8
]);
9
10
// Get background.
11
var background = chart.background();
12
background.stroke('2 #2196F3');
13
background.corners(10);
14
background.fill({
15
keys: [
16
'#FFECB3 0.2',
17
'#FFE082',
18
'#FFECB3 0.2'
19
],
20
angle: -90
21
});
22
23
chart.title('Get and modify background object');
24
chart.container('container');
25
chart.draw();
26
});