HTMLcopy
1
<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
anychart.onDocumentReady(function () {
2
var stage = anychart.graphics.create("container");
3
4
var chart = anychart.line([6, 48, 6, 44, 8, 29, 9, 23, 9, 17]);
5
6
chart.left("5%");
7
chart.title("Set facebook sharing settings");
8
chart.container(stage);
9
chart.draw();
10
11
// Set Pinterest sharing settings.
12
anychart.exports.pinterest(
13
"https://www.anychart.com/",
14
"Statistics of visits to the site",
15
"1000",
16
"500"
17
);
18
19
var customLabel = anychart.standalones.label();
20
customLabel.background({fill: "#9E9E9E"});
21
customLabel.text("Share with Pinterest");
22
customLabel.fontColor("#fff");
23
customLabel.padding(5);
24
customLabel.offsetX(5);
25
customLabel.listen("mouseOver", function () {
26
document.body.style.cursor = "pointer";
27
});
28
customLabel.listen("mouseOut", function () {
29
document.body.style.cursor = "auto";
30
});
31
customLabel.listen("click", function () {
32
chart.shareWithPinterest();
33
});
34
customLabel.container(stage);
35
customLabel.draw();
36
});