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
chart = anychart.pyramid([
4
{x: 'Physical', value: 125},
5
{x: 'Data Link', value: 125},
6
{x: 'Network', value: 125},
7
{x: 'Transport', value: 125},
8
{x: 'Session', value: 125},
9
{x: 'Presentation', value: 125},
10
{x: 'Application', value: 290}
11
]);
12
chart.labels(false);
13
chart.title('Share with Facebook');
14
chart.container('container');
15
chart.draw();
16
});
17
18
function shareWithFacebook() {
19
20
// Share chart with Facebook.
21
chart.shareWithFacebook('ANYCHART.COM', 'https://www.anychart.com/', 'Pyramid chart', 'Training chart');
22
}