Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
chartjs-plugin-gradient
Advanced tools
Easy gradients for Chart.js
This plugin requires Chart.js 3.0.0 or later. It should also work with v2, but there are no regressing tests to guarantee this.
NOTE the plugin does not automatically register.
NPM:
npm i --save-dev chartjs-plugin-gradient
CDN:
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-gradient"></script>
ESM
import gradient from 'chartjs-plugin-gradient';
CDN
const gradient = window['chartjs-plugin-gradient'];
All charts
Chart.register(gradient);
Signle chart
const chart = new Chart(ctx, {
// ...
plugins: {
gradient
}
});
The gradient colors are configured in the gradient
key of dataset
const chart = new Chart(ctx, {
data: {
datasets: [{
// data
gradient: {
backgroundColor: {
axis: 'y',
colors: {
0: 'red',
50: 'yellow',
100: 'green'
}
},
borderColor: {
axis: 'x',
colors: {
0: 'black',
1: 'white',
2: 'black',
3: 'white'
}
}
}
}]
}
});
chartjs-plugin-gradient.js
is available under the MIT license.
FAQs
Easy gradient colors for Chart.js
The npm package chartjs-plugin-gradient receives a total of 4,589 weekly downloads. As such, chartjs-plugin-gradient popularity was classified as popular.
We found that chartjs-plugin-gradient demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.