Open 51yu opened 8 months ago
@typpo Any thoughts on this? I'm experiencing the same issue
Python example, inspired by: https://developers.google.com/chart/interactive/docs/gallery/geochart
import requests
code = '''
var container = document.getElementById('geochart');
var chart = new google.visualization.GeoChart(container);
var data = google.visualization.arrayToDataTable([
['Country', 'Popularity'],
['Germany', 200],
['United States', 300],
['Brazil', 400],
['Canada', 500],
['France', 600],
['RU', 700]
]);
var options = {}
chart.draw(data, options);
'''
resp = requests.post('https://quickchart.io/google-charts/render', json={
'width': 600,
'height': 300,
'packages': 'geochart', # optional
'code': code,
'mapsApiKey': '<MY GMAPS API KEY; however, it gives the same error regardless>',
})
with open('chart.png', 'wb') as f:
f.write(resp.content)
Execution
$ python quickchart.py
$ cat chart.png
Error: Evaluation failed: Error: Must draw chart before calling getImageURI.
at gvjs_E_.gvjs_.ah (https://www.gstatic.com/charts/51/js/jsapi_compiled_geochart_module.js:81:133)
at __puppeteer_evaluation_script__:5:25%
Reproduce