Comments (9)
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.
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.
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.
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.
Looks like the Google Charts API now includes some similar functionality: https://developers.google.com/chart/interactive/docs/printing
from chartkick.
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.
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.
Hi, is possible to integrate the download tree to the new version 1.4.1??
from chartkick.
The latest version of Chartkick has a download
option.
from chartkick.
Related Issues (20)
- Better adding of plugins to Chart.js with Chartkick HOT 9
- Charts stuck at "Loading..." [example included] HOT 4
- CSP compliance breaks when used with Turbo Drive w/ and random nonce generator HOT 3
- Add support for chart.js 4.x HOT 3
- Add combo bar/line charts HOT 2
- Jruby Support HOT 1
- Support for Apex Charts HOT 1
- Add support for limiting the serie to a certain time frame HOT 1
- Support for polar (spiderweb) charts HOT 1
- Demo not rendering correctly in Safari HOT 2
- `createChart` is not fired after Turbo Frame renders the view HOT 8
- Comparisons in Two Date Ranges HOT 1
- Error importing Chartkick object HOT 2
- Provide ES module for JS with default exports HOT 1
- Rails 7 Setup Additional Step Needed HOT 4
- Canvas accessibility options like aria-label HOT 1
- preffix and suffix on column HOT 1
- X-axis is converted to integers even if datapoint contains alphanumeric characters HOT 1
- Some plugins not (fully) working with Chartkick with Importmaps HOT 2
- Conflicts with Action_text from rails and do not displaying in production(Heroku) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chartkick.