JSPM

  • Created
  • Published
  • Downloads 19968
  • Score
    100M100P100Q150476F
  • License MIT

This plugin for Chart.js that makes your bar chart to 100% stacked bar chart

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.

Installation

npm install chartjs-plugin-stacked100 --save

Usage

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 }
    }
  }  
});

Result image