I have a system where students are enrolled in training classes, every registered student is "scheduled" to attend and when he / she attends, in addition he /
What I want is to make a chart using Highcharts that compares the number of students in a certain area who were expected to do that training in that month and the amount they actually did.
The php:
<?php
require('conn.php');
$prevJan= "SELECT COUNT(*) FROM participantes WHERE PREVISTO = 'Previsto' and FORMACAO = 'Revues Techniques' and MES = 'jan' and AREA = 'R&D'";
$realJan= "SELECT COUNT(*) FROM participantes WHERE REALIZADO = 'Realizado' and FORMACAO = 'Revues Techniques' and MES = 'jan' and AREA = 'R&D'";
$rsp = mysqli_fetch_all($mysqli->query($prevJan));
$rsr = mysqli_fetch_all($mysqli->query($realJan));
$totalp = mysql_num_rows($rsp);
$totalr = mysql_num_rows($rsr);
$listap = array($prevJan);
?>
The Highchart chart:
<script type="text/javascript">
Highcharts.chart('container', {
chart: {
zoomType: 'xy'
},
title: {
text: 'Reveus Techniques'LOP
},
subtitle: {
text: 'R&D'
},
xAxis: [{
categories: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dec'],
crosshair: true
}],
yAxis: [{ // Primary yAxis
labels: {
format: '{value}',
style: {
color: Highcharts.getOptions().colors[1]
}
},
title: {
text: '',
style: {
color: Highcharts.getOptions().colors[1]
}
}
}, { // Secondary yAxis
title: {
text: '',
style: {
color: Highcharts.getOptions().colors[0]
}
},
labels: {
format: '{value} ',
style: {
color: Highcharts.getOptions().colors[0]
}
},
opposite: true
}],
tooltip: {
shared: true
},
legend: {
layout: 'vertical',
align: 'left',
x: 120,
verticalAlign: 'top',
y: 100,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
},
series: [{
name: 'Realizado',
type: 'column',
yAxis: 1,
data: [<?php echo join($datar, ',') ?>],
tooltip: {
valueSuffix: ''
}
}, {
name: 'Previsto',
type: 'spline',
data: [<?php echo join($datap, ',') ?>],
tooltip: {
valueSuffix: ''
}
}]
});
</script>
I suppose I'm going to need to make this select
into a value, insert it into a list, and deliver that list to highchart, but I do not master that language and I have a lot of idea how to do it.
If anyone could help me, that would be great. :)
obs: Furthermore, the graph simply disappeared from my page