Age share of MACJ-2015 batch : Google Code Playground [Pie Chart]
The following infographic has been made on Google Code Playground based on the data sourced from the students of AJK MCRC, 2015 batch.
The idea was to show age-wise distribution of students of MACJ 2015 students through Google Code Playground, as previously done in Google Fusion Tables.
The option to depict data through a 'pie-chart- was selected from the left pane. It showed a sample chart with dummy data. The chart showed results in percentage with legends on the right.
The data we collected under 'age' of our primary survey was collected and aggregated in groups. Students of same age were grouped together. For example, 4 students were aged 21, so for the age-group 21, the data value was 4, and so on. Subsequent data was input in the given code along with changes in the classification titles to, 'Age', and 'Number of students'.
Once all the data was recorded, the code was run. The result was displayed in the pane below. The HTML code was available promptly which was copied and pasted on this blog.
// <![CDATA[ google.load('visualization', '1', {packages: ['corechart']}); // ]]> // <![CDATA[ function drawVisualization() { // Create and populate the data table. var data = google.visualization.arrayToDataTable([ ['Age', 'Number of students'], ['21', 4], ['22', 7], ['23', 3], ['24', 1], ['25', 1], ['26', 1] ]); // Create and draw the visualization. new google.visualization.PieChart(document.getElementById('visualization')). draw(data, {title:"Age share of MACJ 2015 students"}); } google.setOnLoadCallback(drawVisualization); // ]]>








