HTMLcopy
1
<button onclick="shareWithTwitter();">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.surface(getData());
4
chart.title('Share with Twitter');
5
chart.container('container');
6
chart.draw();
7
});
8
9
function shareWithTwitter() {
10
11
// Share chart with Twitter.
12
chart.shareWithTwitter();
13
}
14
15
function getData() {
16
return [
17
[-3, -3, -216],
18
[-3, -2, -125],
19
[-3, -1, -64],
20
[-3, 0, -27],
21
[-3, 1, -8],
22
[-3, 2, -1],
23
[-3, 3, 0],
24
[-2, -3, -125],
25
[-2, -2, -64],
26
[-2, -1, -27],
27
[-2, 0, -8],
28
[-2, 1, -1],
29
[-2, 2, 0],
30
[-2, 3, 1],
31
[-1, -3, -64],
32
[-1, -2, -27],
33
[-1, -1, -8],
34
[-1, 0, -1],
35
[-1, 1, 0],
36
[-1, 2, 1],
37
[-1, 3, 8],
38
[0, -3, -27],
39
[0, -2, -8],
40
[0, -1, -1],
41
[0, 0, 0],
42
[0, 1, 1],
43
[0, 2, 8],
44
[0, 3, 27],
45
[1, -3, -8],
46
[1, -2, -1],
47
[1, -1, 0],
48
[1, 0, 1],
49
[1, 1, 8],
50
[1, 2, 27],
51
[1, 3, 64],
52
[2, -3, -1],
53
[2, -2, 0],
54
[2, -1, 1],
55
[2, 0, 8],
56
[2, 1, 27],
57
[2, 2, 64],
58
[2, 3, 125],
59
[3, -3, 0],
60
[3, -2, 1],
61
[3, -1, 8],
62
[3, 0, 27],
63
[3, 1, 64],
64
[3, 2, 125],
65
[3, 3, 216]
66
]
67
}