HTMLcopy
1
<button onclick="shareWithFacebook();">Get the sharing dialog</button>
2
<div id="container"></div>
CSScopy
9
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
7
button {
8
margin: 10px 0 0 10px;
9
}
JavaScriptcopy
x
1
var chart;
2
anychart.onDocumentReady(function () {
3
chart = anychart.column([
4
{x: 'USA', value: 2},
5
{x: 'China', value: 5},
6
{x: 'Japan', value: 3},
7
{x: 'Germany', value: 9},
8
{x: 'UK', value: 4}
9
]);
10
chart.title('Share with Facebook');
11
chart.width('100%').height('95%');
12
chart.container('container');
13
chart.draw();
14
});
15
function shareWithFacebook() {
16
17
// Share chart with Facebook.
18
chart.shareWithFacebook('ANYCHART.COM', 'https://www.anychart.com/', 'Column chart', 'Sales statistics by country');
19
}