Gathering detailed insights and metrics for chartjs-chart-error-bars
Gathering detailed insights and metrics for chartjs-chart-error-bars
Gathering detailed insights and metrics for chartjs-chart-error-bars
Gathering detailed insights and metrics for chartjs-chart-error-bars
npm install chartjs-chart-error-bars
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
47 Stars
325 Commits
6 Forks
6 Watching
2 Branches
2 Contributors
Updated on 16 Nov 2024
TypeScript (91.14%)
JavaScript (8.86%)
Cumulative downloads
Total Downloads
Last day
-11.2%
1,157
Compared to previous day
Last week
42.6%
9,261
Compared to previous week
Last month
42.1%
28,708
Compared to previous month
Last year
84.9%
212,526
Compared to previous year
1
35
Chart.js module for charting error bars plots. This plugin extends the several char types (bar
, line
, scatter
, polarArea
)
with their error bar equivalent (barWithErrorBars
, lineWithErrorBars
, scatterWithErrorBars
, polarAreaWithErrorBars
).
Bar Chart
Horizontal Bar Chart
Line Chart
Scatterplot
Polar Area plot
Check out also my other chart.js plugins:
1npm install --save chart.js chartjs-chart-error-bars
see Examples
Several new styling keys are added to the individual chart types
The data structure depends on the chart type. It uses the fact that chart.js is supporting scatterplots. Thus, it is already prepared for object values.
bar
and line
see TypeScript Interface:
bar
with indexAxis: 'y'
scatter
a combination of the previous two ones
and
polarArea
Multiple error bars are supported.
The styling options support different array version.
Note: as with other chart.js style options, using an array will be one value per dataset. Thus, to specify the values for different error bars, one needs to wrap it in an object with a v
key having the value itself. The outer for the dataset, the inner for the error bars.
see TypeScript interface:
Just use array of numbers for the corresponding data structures attributes (xMin
, xMax
, yMin
, yMax
). The error bars will be rendered in reversed order. Thus, by convention the most inner error bar is in the first place.
e.g.
1{ 2 y: 4, 3 yMin: [2, 1], 4 yMax: [5, 6] 5}
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 { BarWithErrorBarsController, BarWithErrorBar } from 'chartjs-chart-error-bars'; 3 4// register controller in chart.js and ensure the defaults are set 5Chart.register(BarWithErrorBarsController, BarWithErrorBar, LinearScale, CategoryScale); 6 7const chart = new Chart(document.getElementById('canvas').getContext('2d'), { 8 type: BarWithErrorBarsController.id, 9 data: { 10 labels: ['A', 'B'], 11 datasets: [ 12 { 13 data: [ 14 { 15 y: 4, 16 yMin: 1, 17 yMax: 6, 18 }, 19 { 20 y: 2, 21 yMin: 1, 22 yMax: 4, 23 }, 24 ], 25 }, 26 ], 27 }, 28});
Variant B:
1import { BarWithErrorBarsChart } from 'chartjs-chart-error-bars'; 2 3const chart = new BarWithErrorBarsChart(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.
Reason
27 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
Found 0/2 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More