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
Exporting this amazing chart #313
Comments
Hi , C3 charts are the best available charts.I can't believe how easy is it generate any chart. The only thing is that how do I export a chart? Please help me with this regard. thanks. |
i am also trying to export the chart to pdf or i want to convert it to image ...if anyone has an idea please help |
It's not that easy to do solely in Javascript, especially if you want to support many browser versions. If browser supports canvas (all modern browsers do), there is rather easy way. You can use canvg (https://code.google.com/p/canvg/) library, which converts SVG to canvas. |
Hi, I find this it might be useful (http://jsfiddle.net/8ypxW/3/) but I am not successful yet. |
I'm doing this for the C3-based chart builder I'm working on, will share my code once it's done. Agreed with @lblb's point about canvg, that's what Quartz use in their ChartBuilder. For an idea how to do this, in addition to outputting PNGs, see: https://github.com/Quartz/Chartbuilder/blob/master/js/chartbuilder.js#L295 |
Okay, gotten this working. Here's my Angular directive for doing this, much shamelessly taken from Quartz/Chartbuilder. Ignore all the Angular stuff, all the real work is done in In short, here's what I needed to do:
Note I've only really tested this with simple series charts, it's very very possible the other chart types will have issues and will need their own specific tweaks. Edit: Latest edit: I've updated the Gist, it should work for all chart types now, both PNG and SVG. hoping to release LlamaCharts sometime in the next few days if anyone wants a working implementation to play with. |
Hi @Aendrew I have been working on an exporter, which supports However, my method is a server-side implementation that relies on phantomjs. In my opinion it would be a good idea to have a client-side exporter as well. I'd love to see your completed version |
@yuvii Hi! I've released my project (probably should have updated this issue...), it's at times/axisJS. You can play with it online at http://times.github.io/axisJS/ PDF is super useful, will take a look at your PR. I'm ultimately needing print formats for axisJS sometime shortly... |
Oh wow, you actually went ahead and made an entire GUI for this. I just made a command line tool for exporting. Very cool, man. |
Hi , I am trying to convert c3 chart i.e SVG into Image but its not working. |
@raj-mehta Please ask on the C3 Google Group, this is a closed issue and the lack of detail you've provided with your query makes it practically impossible to help you. |
I'm getting the same issue as raj-mehta with the extra wide axis bars. Did you find a solution to this? |
The issue is that only inline styles matter when doing the export. I've modified my local version of c3 to include some additional styling (like fill-opacity:0 for line graphs that show a weird black background) and the image comes out how you'd expect. |
@Aendrew please tell me the source of this http://times.github.io/axisJS/#/ i need this tutorial..please help me |
You can add PNG exporting feature to c3 charts using my module: https://github.com/annatomka/ng-c3-export |
Hi @annatomka can I use https://github.com/annatomka/ng-c3-export whith async load graphs ? My code: app.controller("ChartController", function ($http) { --Draws the chart correctly but no download icon |
@annatomka Great module but I'm also having trouble with async loading graphs. The download button disappears once I re-generate the graph. |
@annatomka That is so good! I'm totally using your module next Angular project I do! |
@annatomka +1 |
@morales-franco @johnmarkli I fixed the async loading issue, you can try it in the new version (0.1.5). I added some examples too. |
@annatomka My Pie chart is coming out to be |
@annatomka Great module but I'm also having trouble with the browsers. It don't work on Internet Explorer your module. Can you please fix the bug? Thanks |
Seriously here, people. If you have issues with annatomka/ng-c3-export, report them in the annatomka/ng-c3-export issue queue. Locking thread. |
No description provided.
The text was updated successfully, but these errors were encountered: