I need to put a json from eloquent in a google chart but I can't convert the result from eloquent to a correct dataTable
//activos represents result from eloquent
var activos = [
{"descripcion":"peri\u00f3dico","riesgo":"5"},
{"descripcion":"autom\u00e1ticas ","riesgo":"2"},
{"descripcion":" \tAusencia","riesgo":"2"},
{"descripcion":" \tAusencia de alto riesgo","riesgo":"4"},
{"descripcion":"negocio","riesgo":"3"}
];
google.charts.load('current', {
'packages': ['corechart']
});
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Descripcion');
data.addColumn('number', 'Cantidad');
data.addRows(activos);
// Set chart options
var options = {
'title': 'Reporte de Activos',
'width': 400,
'height': 300,
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
the chart doen't apear
