
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
chartjs-plugin-doughnutlabel-rebourne
Advanced tools
Chart.js plugin for doughnut chart to display lines of text in the center
Chart.js plugin module that allows to display multiple lines of text centered in the middle area of the doughnut charts
Have a look at the Demo page.
Install through npm:
npm install --save chartjs-plugin-doughnutlabel
var myDoughnutChart = new Chart(ctx, {
type: 'doughnut',
data: data,
options: {
plugins: {
doughnutlabel: {
labels: [
{
text: 'The title',
font: {
size: '60'
}
},
{
text: getTotal,
font: {
size: '50'
},
color: 'grey'
},
{
text: '$100.000',
font: {
size: '30'
},
color: 'red'
},
{
text: '95%',
font: {
size: '45'
},
color: 'green'
}
]
}
}
}
});
var getTotal = function(myDoughnutChart) {
var sum = myDoughnutChart.config.data.datasets[0].data.reduce((a, b) => a + b, 0);
return `Total: ${sum}`;
}
The plugin can be manually downloaded from the Releases page on GitHub!
<script src="chartjs-plugin-doughnutlabel.js"></script>
or use the minified version
<script src="chartjs-plugin-doughnutlabel.min.js"></script>
You first need to install node dependencies (requires Node.js):
> npm install
The following commands will then be available from the repository root:
> gulp lint // perform code linting
> gulp build // build dist files
> gulp build --watch // build and watch for changes
> gulp package // create an archive with dist files and samples
For an example on how to use this plugin with angular, please check this stackblitz prototype: doughnutlabel plugin in angular
chartjs-plugin-doughnutlabel
is available under the MIT license.
FAQs
Chart.js plugin for doughnut chart to display lines of text in the center
The npm package chartjs-plugin-doughnutlabel-rebourne receives a total of 9,784 weekly downloads. As such, chartjs-plugin-doughnutlabel-rebourne popularity was classified as popular.
We found that chartjs-plugin-doughnutlabel-rebourne 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.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.