Skip to main content
Grammar and tag edits to include javascript and google-pie-chart
Source Link

I did not managedmanage to set up a link where an OnClickonClick() - action would generate ana Goolge pie chart. Here is an example via JSFiddle.

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <div id="piechart" style="width: 900px; height: 500px;"></div> google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Task', 'Hours per Day'], ['Work', 11], ['Eat', 2], ['Commute', 2], ['Watch TV', 2], ['Sleep', 7] ]); var options = { title: 'My Daily Activities' }; var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); } 

I would like to have a clickable text or string such that after a click ana small window or pop-up window appears with the chart in it. Is this possible?

Thanks in advance.

I did not managed to set up a link where an OnClick - action would generate an Goolge pie chart. Here is an example via JSFiddle.

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <div id="piechart" style="width: 900px; height: 500px;"></div> google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Task', 'Hours per Day'], ['Work', 11], ['Eat', 2], ['Commute', 2], ['Watch TV', 2], ['Sleep', 7] ]); var options = { title: 'My Daily Activities' }; var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); } 

I would like to have a clickable text or string such that after a click an small window or pop-up window appears with the chart in it. Is this possible?

Thanks in advance.

I did not manage to set up a link where an onClick() - action would generate a Goolge pie chart. Here is an example via JSFiddle.

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <div id="piechart" style="width: 900px; height: 500px;"></div> google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Task', 'Hours per Day'], ['Work', 11], ['Eat', 2], ['Commute', 2], ['Watch TV', 2], ['Sleep', 7] ]); var options = { title: 'My Daily Activities' }; var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); } 

I would like to have a clickable text or string such that after a click a small window or pop-up window appears with the chart in it. Is this possible?

Thanks in advance.

Source Link
V. Wolf
  • 123
  • 1
  • 8

Show Google pie charts on click at text or image?

I did not managed to set up a link where an OnClick - action would generate an Goolge pie chart. Here is an example via JSFiddle.

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <div id="piechart" style="width: 900px; height: 500px;"></div> google.charts.load('current', {'packages':['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Task', 'Hours per Day'], ['Work', 11], ['Eat', 2], ['Commute', 2], ['Watch TV', 2], ['Sleep', 7] ]); var options = { title: 'My Daily Activities' }; var chart = new google.visualization.PieChart(document.getElementById('piechart')); chart.draw(data, options); } 

I would like to have a clickable text or string such that after a click an small window or pop-up window appears with the chart in it. Is this possible?

Thanks in advance.