HTMLcopy
1
<button onclick="chart.shareWithFacebook();">Share with Facebook</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.pie([
4
{x: 'Cycling', value: 10},
5
{x: 'Swimming', value: 12},
6
{x: 'Run', value: 18},
7
{x: 'Hiking', value: 11},
8
{x: 'Alpinism', value: 9}
9
]);
10
// To work with exports you need to reference the exports module from AnyChart CDN
11
// (https://cdn.anychart.com/releases/8.13.0/js/anychart-exports.min.js for latest or https://cdn.anychart.com/releases/8.13.0/js/anychart-exports.min.js for the versioned file)
12
13
// Set exports settings.
14
chart.exports({facebook: {caption: 'ANYCHART.COM', description: 'Pie chart'}});
15
16
chart.title('Set exports settings');
17
chart.container('container');
18
chart.draw();
19
});