Uncaught (in promise) TypeError: google.visualization.arrayToDataTable is not a function at drawVisualization

121 views
Skip to first unread message

Deepak Alexander

unread,
Jun 17, 2020, 11:57:56 AM6/17/20
to Google Visualization API
Team,

I started getting this java script error while i am trying to load the chart. It was always working but recently it stopped working. Does anyone have any idea about this issue with Google charts.

Daniel LaLiberte

unread,
Jun 17, 2020, 3:15:46 PM6/17/20
to Google Visualization API
Hi Deepak,

I bet you are using the old jsapi loader, and possibly not using google.setOnLoadCallback.   If so, see the instructions on updating how you load the visualization library at:   https://developers.google.com/chart/interactive/docs/basic_load_libs#update-library-loader-code

If this doesn't help, please post more details about how you are loading the library.

On Wed, Jun 17, 2020 at 11:58 AM Deepak Alexander <alexande...@gmail.com> wrote:
Team,

I started getting this java script error while i am trying to load the chart. It was always working but recently it stopped working. Does anyone have any idea about this issue with Google charts.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/77c7b105-608c-490b-b06a-b0eaa37cef5ao%40googlegroups.com.


--

Deepak Alexander

unread,
Jun 17, 2020, 8:11:40 PM6/17/20
to google-visua...@googlegroups.com
This is how i am loading the library. Please let me know what is the problem.

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js">
</script>

<script type='text/javascript'>
google.charts.load('current', {packages: ['corechart']});
google.charts.setOnLoadCallback(drawVisualization);
function drawVisualization() {
var data = google.visualization.arrayToDataTable([
['EventDate', '3M E coli'],['09/29/11',767],['10/25/11',133],['11/28/11',667],['01/12/12',467],['02/29/12',133],['04/25/12',67],['05/30/12',233],['06/27/12',300],['07/30/12',300],['08/30/12',133],['09/29/12',133],['11/30/12',0],['12/31/12',67],['01/30/13',67],['02/28/13',200],['07/30/13',200],['08/28/13',200],['02/23/14',400],['04/05/14',367],['04/27/14',233],['09/19/14',67],['10/24/14',0],['11/14/14',0],['01/29/15',33],['02/26/15',200],['03/17/15',33],['04/23/15',67],['08/25/15',100],['10/13/15',633],['10/13/15',633],['11/05/15',367]],false);var options = { title : '3M E coli value by Event Date', vAxis: {title: '3M E coli'}, hAxis: {title: 'Event Date'}, seriesType: 'graph', series: {3: {type: 'area'}} }; var chart = new google.visualization.ComboChart(document.getElementById('chart_line')); chart.draw(data, options); } </script>



--
Thanks & Regards,
 
Deepak Alexander
 
"Commit to the LORD whatever you do, and your plans will succeed"
Proverbs 16:3
 

Daniel LaLiberte

unread,
Jun 17, 2020, 9:14:23 PM6/17/20
to Google Visualization API
Here is your chart working in a jsfiddle:   https://jsfiddle.net/dlaliberte/mcxkr7oa/1/  
Seems to work fine.  I added a div with id="chart_line".

Message has been deleted

Ethan Allan

unread,
Jun 18, 2020, 10:57:43 AM6/18/20
to Google Visualization API
The issue was taken care. There was other javascript that was messing up on the page. Thanks a lot for your help on this.
Reply all
Reply to author
Forward
0 new messages