HTMLcopy
1
<button onclick="enableBackground()">Enable background</button>
2
<button onclick="disableBackground();">Disable background</button>
3
<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
var chart;
2
3
function disableBackground() {
4
5
// Disable background.
6
chart.background(false);
7
}
8
9
function enableBackground() {
10
11
// Enable background.
12
chart.background(true);
13
}
14
anychart.onDocumentReady(function () {
15
chart = anychart.column3d([
16
{x: 'Meat', value: 10},
17
{x: 'Fruit', value: 12},
18
{x: 'Nuts', value: 18},
19
{x: 'Milk', value: 11},
20
{x: 'Fish', value: 5}
21
]);
22
chart.background('#FFF59D 0.4');
23
chart.title('Enable/Disable chart background');
24
chart.container('container');
25
chart.draw();
26
});