Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
chartjs-plugin-gradient
Advanced tools
Easy gradient colors for Chart.js
Weekly downloads
Readme
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 5,665 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
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.