GithubHelp home page GithubHelp logo

Export to image? about chartkick HOT 9 CLOSED

ankane avatar ankane commented on May 2, 2024 2
Export to image?

from chartkick.

Comments (9)

ankane avatar ankane commented on May 2, 2024

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

from chartkick.

ankane avatar ankane commented on May 2, 2024

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.

from chartkick.

davidkariuki avatar davidkariuki commented on May 2, 2024

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.

from chartkick.

ankane avatar ankane commented on May 2, 2024

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.

from chartkick.

auzroz avatar auzroz commented on May 2, 2024

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

from chartkick.

duboff avatar duboff commented on May 2, 2024

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?

from chartkick.

ankane avatar ankane commented on May 2, 2024

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.

from chartkick.

MatiasL13 avatar MatiasL13 commented on May 2, 2024

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

from chartkick.

ankane avatar ankane commented on May 2, 2024

The latest version of Chartkick has a download option.

from chartkick.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.