mejoras en la graficacion de estadisticas

This commit is contained in:
humano 2017-10-29 19:46:36 -05:00
parent 838713124c
commit e87cdd6893

View File

@ -587,7 +587,7 @@ if($mostrar[0] !="") {
return $contenido;
}
$consulta = "SELECT count(control) as cantidad , id_campo ,contenido FROM `form_datos`, `form_campos` WHERE `form_datos`.id_campo = `form_campos`.id AND `id_campo` = '$id_campo' AND `form_id` = '$id_form' GROUP BY $group order by cantidad";
$consulta = "SELECT count(control) as cantidad , id_campo ,contenido , campo_nombre FROM `form_datos`, `form_campos` WHERE `form_datos`.id_campo = `form_campos`.id AND `id_campo` = '$id_campo' AND `form_id` = '$id_form' GROUP BY $group order by cantidad";
$link=Conectarse();
mysqli_set_charset($link, "utf8");
$sql=mysqli_query($link,$consulta);
@ -599,7 +599,7 @@ mysqli_set_charset($link, "utf8");
$lineas .="<tr><td>$row[cantidad]</td><td>$row[contenido]</td><td></td></tr>";
$datas .="'$row[cantidad]',";
$etiquetas .="'$row[contenido]',";
$etiquetas .="'".html_entity_decode($row['contenido'])." $row[campo_nombre] ($row[cantidad]) ',";
$colores .= "'#".substr(md5(rand()), 0, 6)."',";
}
$datos= json_encode($dato);
@ -611,7 +611,7 @@ $data_grafica= "
datasets: [{
data: $data ,
backgroundColor: $color,
label: 'Cantidad '
label: ''
}],
labels: $etiqueta
@ -645,7 +645,15 @@ $data_grafica },
options: {
responsive: true,
scales: { xAxes: [{display: false}]},
legend: { display: false }
legend: { display: false },
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
var label = data.labels[tooltipItem.index].label;
return label;
}}}
}
};