In this repository you can find a module extending c3 chart library with image exporting functionality.
You can check a working demo here.
Install via npm:
npm install ng-c3-export
Install via bower:
bower install ng-c3-export
First include the library files
ng-c3-export.css (or the minified version of them).
If you use a tool like e.g. wiredep that wires your bower dependencies, you don't have to worry about this step. It will find them because they are configured in the bower.json file.
Add ngC3Export module to your angular module as dependency:
var app = angular;
Put the export-chart directive on the element you use for your c3 chart:
And you're ready to go! Now you should be able to see a grey download icon on your chart in the top right corner.
Currently the following options are availabe:
- exported-file-name: when set, the exported chart will be downloaded with the given name
- Fix c3 pie chart export
- Added removeDefs property, by default: true (if true, it will remove defs property of the svg)
Initial version (Only png export possible)