HTMLcopy
1
<button onclick="shareAsSvg();">Get the link to SVG image</button>
2
<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
anychart.onDocumentReady(function () {
3
chart = anychart.column3d([
4
{x: 'Meat', value: 10},
5
{x: 'Fruit', value: 12},
6
{x: 'Nuts', value: 18},
7
{x: 'Milk', value: 11},
8
{x: 'Fish', value: 5}
9
]);
10
chart.title('Share chart as SVG image');
11
chart.container('container');
12
chart.draw();
13
});
14
15
function shareAsSvg() {
16
17
// Share chart as SVG image.
18
chart.shareAsSvg(function (response) {
19
alert(response);
20
});
21
}