0
The graphics are drawn correctly in html, but this error is in the console.
VM6537:108 Uncaught Error: Container is not defined
/*Graficos*/
google.charts.load('current', {packages: ['corechart']});
google.charts.setOnLoadCallback(drawChartTicketsByClient);
function drawChartTicketsByClient() {
var jsonData = $.ajax({
url: "/client/ajax",
dataType: "JSON",
async: false
}).responseJSON;
var dataArray = [
['Name', 'Tickets'],
];
for (var i = 0; i < jsonData.length; i++) {
var row = [jsonData[i].Name, jsonData[i].Tickets];
dataArray.push(row);
}
var options = {
title: 'Tickets por cliente',
curveType: 'function',
series:{0 :{"color":'#57c8f2'}}
};
var data = google.visualization.arrayToDataTable(dataArray);
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
//**************************//
google.charts.setOnLoadCallback(drawChartTicketsByType);
function drawChartTicketsByType() {
var jsonData = $.ajax({
url: "/ticket/ajax",
dataType: "JSON",
async: false
}).responseJSON;
var dataArray = [
['Description', 'Tickets'],
];
for (var i = 0; i < jsonData.length; i++) {
var row = [jsonData[i].Description, jsonData[i].Tickets];
dataArray.push(row);
}
var options = {
title: 'Tickets por tipo',
curveType: 'function',
series:{0 :{"color":'#E9D460'}}
};
var data = google.visualization.arrayToDataTable(dataArray);
var chart = new google.visualization.LineChart(document.getElementById('chart_div_ticket'));
chart.draw(data, options);
}
//**************************//
google.charts.setOnLoadCallback(drawChartTicketsByTerm);
function drawChartTicketsByTerm() {
var jsonData = $.ajax({
url: "/ticket/term-on/ajax",
dataType: "JSON",
async: false
}).responseJSON;
var dataArray = [
['Name', 'Tickets'],
['No prazo', jsonData[0][0].Tickets],
['Fora do prazo', jsonData[1][0].Tickets],
];
var options = {
title: 'Tickets por prazo',
curveType: 'function',
series:{0 :{"color":'#57c8f2'},
1: {"color": '#ff6c60'}}
};
var data = google.visualization.arrayToDataTable(dataArray);
var chart = new google.visualization.PieChart(document.getElementById('chart_div_ticket_term'));
chart.draw(data, options);
}
Does anyone know what can be?
I don’t see the word
Container
in that code. What is the line108
?– Sergio
This is the problem, can’t see why it doesn’t have kkkkk
– Felipe Paetzold