Olaf
unread,Apr 27, 2013, 2:55:38 AM4/27/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-visua...@googlegroups.com
Hi all,
I use the Google pie chart. I generate the script from a server java class and let it show in a browser. I have a different java script that contains a function. My question is: How can I call this function from my generated Google pie chart script:
+ "var options = {'title':'Content Type', "
+ "'width':800, "
+ "'height':600,"
+ "'chartArea.left':'50%',colors:['red','#706464','#E9DCDC','#3D0808','black']}; "
+ "var chart = new google.visualization.PieChart(document.getElementById('Formular')); "
+ "function selectHandler() { "
+ "var selectedItem = chart.getSelection()[0]; "
+ "if (selectedItem) { "
+ "var auswahl = data.getValue(selectedItem.row, 0); "
+ "alert('The user selected ' + auswahl); " <---------------------------------------------------------------------------Works perfect!
//+ "suSo.push('{\"Funktion\":\"antworten\",\"Text\":\"type\",\"Wert\":auswahl}');" <-------------------Causes the pie chart not to show up when enabled?
+ "} "
+ "} "
+ "google.visualization.events.addListener(chart, 'select', selectHandler); "
+ "chart.draw(data, options); "
+ "} "
+ "</script> ";
I only started to use the GPC. So this might be a newbee question.
Thank you in advance
Olaf