Package Exports
- chartjs-plugin-stacked100
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (chartjs-plugin-stacked100) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
chartjs-plugin-stacked100
This plugin for Chart.js that makes your bar chart to 100% stacked bar chart.
Demo: https://y-takey.github.io/chartjs-plugin-stacked100
Installation
npm install chartjs-plugin-stacked100 --saveUsage
specify plugin options with { stacked100: { enable: true } }.
a example
new Chart(document.getElementById('my-chart'), {
type: 'horizontalBar',
data: {
labels: ["Foo", "Bar"],
datasets: [
{ label: "bad", data: [5, 25], backgroundColor: "rgba(244, 143, 177, 0.6)" },
{ label: "better", data: [15, 10], backgroundColor: "rgba(255, 235, 59, 0.6)" },
{ label: "good", data: [10, 8], backgroundColor: "rgba(100, 181, 246, 0.6)" }
]
},
options: {
plugins: {
stacked100: { enable: true }
}
}
});
Supported chart types
- bar
- horizontalBar
- line (via @HoJSim, thanks!)
Contributing
Pull requests and issues are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request!