There seems to be a conflict when I load Google Analytics Embed API and Google Charts on the same page, more specifically when I use Embed API to draw charts, too.
To make it more interesting, the problem only occurs when the charts are of different type, e.g. Embed API: TABLE and Charts: LINE
Embed API chart is loaded first and works as expected. Charts LINE chart is loaded second and returns this error:
You called the draw() method with the wrong type of data rather than a DataTable or DataView
I have a feeling that Embed API charts override this function:
google.charts.load('current', {
packages: ['corechart', 'line', 'table']
});
UPDATE
Answer for this question: Google Charts draw() method wrong type when given DataTable suggests removing the reference to http://www.google.com/jsapi
, but then Google Embed API charts stop working because window.google.load
is no longer defined, instead there is window.google.charts.load
which is needed for Google Charts but seems not to work work Embed API charts.