I'm trying to plot (with Flot) a pie chart with some data
var data = <?php echo json_encode($data)?>
The result I get from that is this:
var data = [
{"label":"Crear Usuario", "data":"2"},
{"label":"Impresoras", "data":"1"},
{"label":"Problema Correo", "data":"1"},
{"label":"Requisicion Equipo", "data":"1"},
{"label":"Sitio Web", "data":"1"}
]
The problem here is that I need the label
and data
without the quotes, I already tried json_encode($data, JSON_NUMERIC_CHECK);
but only removes the quotes from the numbers.
The following format is what I need:
var data = [
{label:"Crear Usuario",data:2}, ...