-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraf_areas.php
52 lines (43 loc) · 1.49 KB
/
graf_areas.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!--DESENVOLVIDO POR
TOP Artes - Impressões Vídeos e WEB
topartes.com
André Aguiar
31 3327-5397
--><!--Div that will hold the pie chart-->
<div id="chart_div_areas"></div>
<script type="text/javascript">
// Load the Visualization API and the corechart package.
google.charts.load('current', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChartAreas);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChartAreas() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
<?php while($row_categorias = mysqli_fetch_assoc($sl_categ)){
$idCategoria = $row_categorias['id'];
include(SQL_PATH."conta_perguntasCateg.php");
while ($row_RsQtdMaterias = mysqli_fetch_assoc($RsQtdMateriasCateg)){
echo "['";
echo ($row_categorias['categoria']);
echo "',";
echo ($row_RsQtdMaterias['qtd_materiasCateg']);
echo "],";
}
}?>
]);
// Set chart options
var options = {'title':'Matérias por área do conhecimento',
'width':300,
'height':300};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div_areas'));
chart.draw(data, options);
}
</script>