Image export of a highchart graph
Closed this issue · 5 comments
💡 The Idea
I am not sure if this can be done, but would it be possible to export a highchart graph as an image? I know it is possible with the "exporting" setting in highcharts configuration, but that only allows a user to export the graph as an image, when he watches it on a web page.
I would like it to be exported programmatically on every archive interval of weewx, or every x-th update interval through MQTT.
🔨 Breaking Feature
Having an image automatically generated would allow to further process it. For example, send it automatically by email, or in my case, let a telegram bot pull the latest image and forward it to a user.
I am willing to help programming, but my skills with JS and Python are limited.
I don't think this is possible very easily. The graphs are generated at run time, meaning when your browser loads the data, it gets populated. You could look into perhaps a docker container with firefox running, and being able to script firefox to load the page and maybe run a script that'll download the chart you want by chart ID. It's an interesting idea but doesn't seem easy.
Thanks for looking into this. Another way would be to let WeeWX generate also the standard skin. It generates a static website that references images. However, they are not as nice as the Highchart graphs.
Btw. thanks for the Belchertown skin. It is really nice and a job well done!
Glad you like it!
Looks like they do have an automated export utility (they call it a server), and it might run in docker which may make things easier if that's a route you want to explore?
Here's their documentation on it. Good luck with your project! https://github.com/highcharts/node-export-server
Thanks, for the link, I will have a look at it.