Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function errorHandler(errorMessage) {
- //curisosity, check out the error in the console
- console.log(errorMessage);
- //simply remove the error, the user never see it
- google.visualization.errors.removeError(errorMessage.id);
- }
- function drawChart(json) {
- var data = new google.visualization.DataTable(json); //here, JSON is buggy
- var options = {
- title: 'test'
- };
- var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
- //attach the error handler here, before draw()
- google.visualization.events.addListener(chart, 'error', errorHandler);
- chart.draw(data, options);
- }
- var data = google.visualization.arrayToDataTable(sourcedata);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement