HTMLcopy
1
<button onclick="shareAsPdf();">Get the link to PDF file</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
var data = [
4
{x: 'A', value: 20},
5
{x: 'B', value: 12},
6
{x: 'C', value: 17},
7
{x: 'A&B', value: 4},
8
{x: 'B&C', value: 5},
9
{x: 'A&C', value: 7},
10
{x: 'A&B&C', value: 1}
11
];
12
13
chart = anychart.venn(data);
14
chart.title('Share chart as PDF image');
15
chart.container('container');
16
chart.draw();
17
});
18
19
function shareAsPdf() {
20
21
// Share chart as PDF file.
22
chart.shareAsPdf(function (response) {
23
alert(response);
24
});
25
}