Gathering detailed insights and metrics for chartjs-chart-funnel
Gathering detailed insights and metrics for chartjs-chart-funnel
Gathering detailed insights and metrics for chartjs-chart-funnel
Gathering detailed insights and metrics for chartjs-chart-funnel
npm install chartjs-chart-funnel
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
19 Stars
121 Commits
12 Forks
3 Watching
4 Branches
1 Contributors
Updated on 16 Nov 2024
TypeScript (80.02%)
JavaScript (19.98%)
Cumulative downloads
Total Downloads
Last day
0.3%
1,105
Compared to previous day
Last week
7.4%
5,371
Compared to previous week
Last month
13%
21,003
Compared to previous month
Last year
485.2%
150,781
Compared to previous year
2
1
35
Chart.js module for charting funnel plots. This plugin extends with a new char type funnel
.
A Funnel chart is a variant of a bar chart where the bar shrinks on one side to the size of the next bar. In addition, they are usually centered giving the visual impression of a funnel.
Works great with https://github.com/chartjs/chartjs-plugin-datalabels
Check out also my other chart.js plugins:
1npm install chart.js chartjs-chart-funnel
see Examples
Trapezoid Elements are Bar elements and provide the same coloring options. In addition, see TrapezoidElementOptions custom option with respect to shrinking behavior.
In addition, the FunnelController has the following options FunnelController to customize the alignment of the chart.
The ESM build of the library supports tree shaking thus having no side effects. As a consequence the chart.js library won't be automatically manipulated nor new controllers automatically registered. One has to manually import and register them.
Variant A:
1import Chart, { LinearScale, CategoryScale } from 'chart.js'; 2import { FunnelController, TrapezoidElement } from 'chartjs-chart-funnel'; 3 4// register controller in chart.js and ensure the defaults are set 5Chart.register(FunnelController, TrapezoidElement, LinearScale, CategoryScale); 6 7const chart = new Chart(document.getElementById('canvas').getContext('2d'), { 8 type: 'funnel', 9 data: { 10 labels: ['Step 1', 'Step 2', 'Step 3', 'Step 4'], 11 datasets: [ 12 { 13 data: [0.7, 0.66, 0.61, 0.01], 14 }, 15 ], 16 }, 17});
Variant B:
1import { FunnelChart } from 'chartjs-chart-funnel'; 2 3const chart = new FunnelChart(document.getElementById('canvas').getContext('2d'), { 4 data: { 5 //... 6 }, 7});
1npm i -g yarn 2yarn install 3yarn sdks vscode
1yarn install 2yarn build
No vulnerabilities found.
No security vulnerabilities found.