function reportStoryIndividualStatsStoryType($id) { $connection = connectToDb(); $output = ""; $headers = array("Bugs", "Chores", "Features", "Releases", "Total"); $items_array = array(); $items_array[] = "<tr><th>" . $headers[0] . "</th>\n <td>" . ($bugs = countStoryTypeSql($id, "bug", $connection)); $items_array[] = "<tr><th>" . $headers[1] . "</th>\n <td>" . ($chores = countStoryTypeSql($id, "chore", $connection)); $items_array[] = "<tr><th>" . $headers[2] . "</th>\n <td>" . ($features = countStoryTypeSql($id, "feature", $connection)); $items_array[] = "<tr><th>" . $headers[3] . "</th>\n <td>" . ($releases = countStoryTypeSql($id, "release", $connection)); $items_array[] = '<tr class="success"><th>' . $headers[4] . "</th>\n <td>" . ($bugs + $chores + $features + $releases); $items_string = implode("</tr>", $items_array); $output .= $items_string . "</td></tr>"; $connection = null; return $output; }
var data = google.visualization.arrayToDataTable([ ['Story Type','Number of Stories'], ['Bugs', <?php echo countStoryTypeSql($history_id, "bug", $connection); ?> ], ['Chores', <?php echo countStoryTypeSql($history_id, "chore", $connection); ?> ], ['Features', <?php echo countStoryTypeSql($history_id, "feature", $connection); ?> ], ['Releases', <?php echo countStoryTypeSql($history_id, "release", $connection); ?> ] ]); var options = { title: 'Story Types Statistics' }; var chart = new google.visualization.PieChart(document.getElementById('story-type-piechart')); chart.draw(data, options); } </script> <div id="story-type-piechart"></div> <?php