ankane / chartkick

Create beautiful JavaScript charts with one line of Ruby
https://chartkick.com
MIT License
6.33k stars 565 forks source link

Make chart download link image visible at all times #595

Open stephenhighemprise opened 2 years ago

stephenhighemprise commented 2 years ago

I appreciate the client-side ability to download an image file of the chart. The problem is that discoverability is lower than we would like because the user must hover the mouse over the chart area to even see that download image appear. So not so great on desktop and impossible to download on mobile. I noticed that the styles are hardcoded here:

https://github.com/ankane/chartkick/blob/4ad0c0bce42a5b0ea0c011d8d51dc8f5949d1ef8/vendor/assets/javascripts/chartkick.js#L1841

At the very least, it would be great to have an option to pass in a boolean to control whether or not the download link is always visible. Another idea is to pass in styles or classes for it.

aseroff commented 2 years ago

+1. A little bit more configuration options around download would be great. Specifically, my clients would like a big ol' "Download" button separate from the canvas entirely, it would be nice to be able to retrieve the base 64-encoded URL in some way for use elsewhere on the page.

SpiderGoose commented 1 year ago

all good