Re:Show HN: Create Chart Images from a URL
by andrethegiant on Wednesday March 06, 2019 @05:06PM
(#19323388)
Cool! You should multiply the width and height of each chart on your marketing site by `window.devicePixelRatio` so that the graphs look crisp on Retina/HiDPI displays.
[ Parent
| on HN ]
Re:Show HN: Create Chart Images from a URL
by nsedlet on Wednesday March 06, 2019 @06:39PM
(#19324127)
It looks like the charts default to 500x300. It would be nice to be able to pass a parameter specifying the size of the image returned. Then I could set the width of the <img/> to be half of that to get it to show properly on retina at an arbitrary size
The API does support "width" and "height" query parameters to set image size!
Re:Show HN: Create Chart Images from a URL
by nsedlet on Thursday March 07, 2019 @10:59AM
(#19329079)
Ah, I'm wrong, sorry.
I'd been inspecting the image elements to see why they were fuzzy on my retina screen, and didn't see those params - it's in the docs right there on the page though. In that case I'd just update the marketing site to fetch larger images so they look good on retina.
This is a fantastic project, by the way. The need for this comes up all the time for us (e.g. charts for emails).