Created
August 11, 2015 05:37
-
-
Save victorabraham/00a885a2b245e2cb822b to your computer and use it in GitHub Desktop.
Visualforce page to show google chart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <apex:page showheader="false" sidebar="false" controller="myAttendanceController"> | |
| <script type="text/javascript" src="https://www.google.com/jsapi"></script> | |
| <apex:include pageName="header"/> | |
| <script type="text/javascript"> | |
| google.load("visualization", "1", {packages:["corechart"]}); | |
| google.setOnLoadCallback(drawChart); | |
| function drawChart() { | |
| var data = google.visualization.arrayToDataTable([ | |
| ['Status', 'Count'], | |
| ['Attended', {!attendedCount}], | |
| ['Partially Attended', {!partialCount}], | |
| ['Absent', {!absentCount}], | |
| ]); | |
| var options = { | |
| title: 'My Attendance', | |
| pieHole: 0.4, | |
| }; | |
| var chart = new google.visualization.PieChart(document.getElementById('donutchart')); | |
| chart.draw(data, options); | |
| } | |
| </script> | |
| <div class="container"> | |
| <div id="donutchart" style="width: 900px; height: 500px;"></div> | |
| </div> | |
| </apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment