Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export to image? #29

Closed
davidkariuki opened this issue Aug 8, 2013 · 9 comments
Closed

Export to image? #29

davidkariuki opened this issue Aug 8, 2013 · 9 comments

Comments

@davidkariuki
Copy link

Would be a nice feature to have :)

@ankane
Copy link
Owner

ankane commented Aug 9, 2013

Love this idea. The solution should be client-side only, since setting up image processing libraries on the server can be a pain. This sounds like a solid approach: http://stackoverflow.com/questions/3975499/convert-svg-to-image-jpeg-png-etc-in-the-browser

@ankane
Copy link
Owner

ankane commented Aug 11, 2013

Implemented - https://github.com/ankane/chartkick.js/tree/download

However, it won't work in any version of IE due to security restrictions, so the download button is hidden for IE users. A cross-browser compatible approach would be to setup a public server to convert SVGs to PNGs. This approach would work in any browser but would rely on an external service.

@davidkariuki
Copy link
Author

Wow that was fast! I was also thinking about a server-side solution -- maybe using ImageMagick. I haven't had the chance to give it a real try though.

@ankane
Copy link
Owner

ankane commented Aug 13, 2013

Yeah, I was hoping to get away with a client-side solution for simplicity, but since it isn't cross-browser compatible, a server-side solution makes more sense.

@auzroz
Copy link

auzroz commented Mar 9, 2014

Looks like the Google Charts API now includes some similar functionality: https://developers.google.com/chart/interactive/docs/printing

@duboff
Copy link

duboff commented May 1, 2014

Hi,

Is it possible to use this feature in the ruby gem? I couldn't quite figure out how. Do you need to use the JS file from the Download branch since it doesn't seem to be implemented on Master?

@ankane
Copy link
Owner

ankane commented May 2, 2014

Yeah, the branch is pretty outdated, so new features won't be there, but you can just add the file to app/assets/javascripts/chartkick.js and Rails will use it over the one bundled with the gem.

@MatiasL13
Copy link

Hi, is possible to integrate the download tree to the new version 1.4.1??

@cycomachead cycomachead mentioned this issue May 8, 2016
10 tasks
@ankane
Copy link
Owner

ankane commented Dec 5, 2016

The latest version of Chartkick has a download option.

@ankane ankane closed this as completed Dec 5, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Dec 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants