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.scatter();
4
chart.line([
5
{x: 2, value: 5},
6
{x: 2, value: 25},
7
{x: 4, value: 40},
8
{x: 6, value: 25},
9
{x: 6, value: 5},
10
{x: 2, value: 5},
11
{x: 2, value: 25},
12
{x: 6, value: 25}
13
]);
14
15
// To work with exports you need to reference the exports module from AnyChart CDN
16
// (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)
17
18
// Set exports settings.
19
chart.exports({facebook: {caption: 'ANYCHART.COM', description: 'Scatter chart'}});
20
21
chart.title('Set exports settings');
22
chart.xGrid(true).yGrid(true);
23
chart.container('container');
24
chart.draw();
25
});