You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing an object of type DataTable as a data attribute to google-chart does not work.
In the network tab I see a request to localhost that looks like this: http://localhost:9001/[object%20Object]
Documentation in google-chart.js says The data format can be a two-dimensional array or the DataTable format * expected by Google Charts.
What happens actually:
try{// Try to deserialize the value of the `data` property which might be a// serialized array.data=JSON.parse(data);}catch(e){isString=typeofdata==='string'||datainstanceofString;}if(isString){// Load data asynchronously, from external URL.dataPromise=fetch(data).then(response=>response.json());}
In reality you just check if data is string and if not you fetch it (???)
This logic is not documented and looks a bit broken.
Was it done intentionally that you don't support passing of DataTable here?
The text was updated successfully, but these errors were encountered:
@rslawik ehh, I probably was too tired that day passing object as an attribute...
Good to know contributions are welcome,
I will try to find some time to work out a PR
Passing an object of type DataTable as a data attribute to google-chart does not work.
In the network tab I see a request to localhost that looks like this:
http://localhost:9001/[object%20Object]
Documentation in
google-chart.js
saysThe data format can be a two-dimensional array or the DataTable format * expected by Google Charts.
What happens actually:
In reality you just check if
data
is string and if not you fetch it (???)This logic is not documented and looks a bit broken.
Was it done intentionally that you don't support passing of
DataTable
here?The text was updated successfully, but these errors were encountered: