HTMLcopy
1
<button onclick="shareWithFacebook();">Get the sharing dialog</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 with Facebook');
15
chart.container('container');
16
chart.draw();
17
});
18
19
function shareWithFacebook() {
20
21
// Share chart with Facebook.
22
chart.shareWithFacebook('ANYCHART.COM', 'https://www.anychart.com/', 'Venn chart', 'Chart description');
23
}