Skip to content
Advertisement

google chart error without message or error id

Like i mentioned in the title i get an error in the chart but no mesage so i cant fix it. Also the chart is function well. Here is a picture of the chart. it looks fine and the onhover and onclick functions of the chart are working too.

error pic

Here is my JS for the chart. The tabs may be a bit weird because of the way im inserting it in to stackoverflow. Its almost the same as the example charts. I have added listener to check if window size changes and i have a few buttons on the page that give the json call a value to query with.finally there is a function to get $_GET variables.

JavaScript

Advertisement

Answer

you can listen for the 'error' event on the chart, which may provide more details

google.visualization.events.addListener(chartInstance, 'error', handler);

handler will receive an argument with two properties, id & message

you can then removeError using the id or simply removeAll using the chart container

also, when using Material charts, you should convert the options…
google.charts.Bar.convertOptions(options)

(note the difference in the gridlines)

see following example…

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement