Open slifty opened 2 years ago
If using a canvas approach for rendering at least, this SO question might help for saving: https://stackoverflow.com/questions/11112321/how-to-save-canvas-as-png-image
Alternatively, SVG could work for the chart portions -- https://medium.com/hackernoon/a-simple-pie-chart-in-svg-dbdd653b6936
This would mean that the chart becomes an HTML rendering, at which point we enter the world of "div-to-png conversion" -- https://stackoverflow.com/questions/18581379/how-to-save-the-contents-of-a-div-as-a-image
Another useful approach -- https://stackoverflow.com/questions/5433806/convert-embedded-svg-to-png-in-place
I'm moving forward with use of svg for this.
We want to support non-solid fills in the chart so this will come in handy: https://stackoverflow.com/questions/13069446/simple-fill-pattern-in-svg-diagonal-hatching
This is the big one -- how do we want to render the chart in the rework.
One approach is to use a server side process like the current tally does; the benefit to this approach is that we generate an image asset from the input and that makes it easier to share. The downsides are:
Part of implementing this issue is making this decision