A download data plugin for Chart.js
Adds a hover button in the top right corner of the chart area
npm i chartjs-plugin-downloaddata
import DownloadDataPackage from 'chartjs-plugin-downloaddata';
Chart.register( DownloadDataPackage );
In order to use this plugin with coroowicaksono/chart-js-integration
package add these lines to vendors/coroowicaksono/chart-js-integration/resources/js/chart-js-integration.js
import DownloadDataPackage from 'chartjs-plugin-downloaddata';
...
Chart.register(DownloadDataPackage);
Then run npm run dev
from vendors/coroowicaksono/chart-js-integration
folder
In the ChartCard add
->options([
...
'plugins' => [
'download' => true
]
])
...
buttonTitle: button title (default = 💾 - disk html special char) top: top position [px] (default = 28) right: right position [px] (default = 26) opacity: background transparency from 0 to 1 (default = .4)
No documentation yet
chartjs-plugin-downloaddata.js is available under the MIT license.