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.surface(getData());
4
5
// To work with exports you need to reference the exports module from AnyChart CDN
6
// (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)
7
8
// Set exports settings.
9
chart.exports({facebook: {caption: 'ANYCHART.COM', description: 'Surface chart'}});
10
chart.container('container');
11
chart.draw();
12
});
13
14
function getData() {
15
return [
16
[-3, -3, -216],
17
[-3, -2, -125],
18
[-3, -1, -64],
19
[-3, 0, -27],
20
[-3, 1, -8],
21
[-3, 2, -1],
22
[-3, 3, 0],
23
[-2, -3, -125],
24
[-2, -2, -64],
25
[-2, -1, -27],
26
[-2, 0, -8],
27
[-2, 1, -1],
28
[-2, 2, 0],
29
[-2, 3, 1],
30
[-1, -3, -64],
31
[-1, -2, -27],
32
[-1, -1, -8],
33
[-1, 0, -1],
34
[-1, 1, 0],
35
[-1, 2, 1],
36
[-1, 3, 8],
37
[0, -3, -27],
38
[0, -2, -8],
39
[0, -1, -1],
40
[0, 0, 0],
41
[0, 1, 1],
42
[0, 2, 8],
43
[0, 3, 27],
44
[1, -3, -8],
45
[1, -2, -1],
46
[1, -1, 0],
47
[1, 0, 1],
48
[1, 1, 8],
49
[1, 2, 27],
50
[1, 3, 64],
51
[2, -3, -1],
52
[2, -2, 0],
53
[2, -1, 1],
54
[2, 0, 8],
55
[2, 1, 27],
56
[2, 2, 64],
57
[2, 3, 125],
58
[3, -3, 0],
59
[3, -2, 1],
60
[3, -1, 8],
61
[3, 0, 27],
62
[3, 1, 64],
63
[3, 2, 125],
64
[3, 3, 216]
65
]
66
}