-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
67 lines (51 loc) · 1.82 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<title></title>
</head>
<body>
<div id="chart_div"></div>
<input type="text" id="mensaje" size="30" value="Texto de la imagen...">
<a href="#" id="compartir">Compartir en FB</a>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://www.gstatic.com/charts/loader.js"></script>
<script src="fbshare.php?js&appid=614167212077041"></script>
<script>
function compartido(e) {
console.log("Compartir dice: " + e.result + ", " + e.msg);
}
var imgData;
// Load the Visualization API and the corechart package.
google.charts.load('current', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
['Mushrooms', 3],
['Onions', 1],
['Olives', 1],
['Zucchini', 1],
['Pepperoni', 2]
]);
var options = {'title':'Cuanta pizza comi anoche?',
'width':400,
'height':300};
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
// chartsetup(
// - chart object,
// - id del objeto que inicia de la accion compartir al recibir un click, href button etc. ,
// - id del objeto del cual se va a tomar el texto del mensaje que va a tener la foto en FB,
// - funcion de exito que se llama cuando se compartio el post
// )
chartSetup(chart,'compartir','mensaje',compartido);
chart.draw(data, options);
}
</script>
</body>
</html>