Comments (4)
thank you for the help actually after integrate the api I create the html and center it inside the legand with taking datasets backgroundColor
var htmlArea = "";
var i = 0;
for (var area in cancelledAreas) {
htmlArea += '<p>'+ '<b>' + cancelledAreas[area]+ '</b>'+ ' ' +' '+'<span style="color:'+whereCanceledData.datasets[0].backgroundColor[i]+'">'+ area +'</span>'+'</p>';
i++;
}
document.getElementById('js-legend').innerHTML = htmlArea;
Thanks
from chartjs-plugin-doughnutlabel.
This plugin does not work with pie charts. So, first you have to set type: 'doughnut'
Then add the following object to the plugins object:
doughnutlabel: {
labels: [
{
text: '50% Dubai',
font: {
size: '14'
},
color: "#F38C83"
},
{
text: '36% Abu Dhabi',
font: {
size: '14'
},
color: "#E173C2"
},
{
text: '14% Fujairah',
font: {
size: '14'
},
color: "#A176E8"
}
]
}
from chartjs-plugin-doughnutlabel.
Hi @rehamwael ,
This also doesn't currently allow for different text fonts on the same line of text, it just allows you to configure one font (size, color) for one line.
I'm thinking maybe to allow for an array of lines, each line consisting of an array of labels (each with its own font configuration). What do you think, would that help?
from chartjs-plugin-doughnutlabel.
@rehamwael Could you provide a jsfiddle how to exactly use this? I am not sure how you put the pieces together. Thanks!
from chartjs-plugin-doughnutlabel.
Related Issues (19)
- Different font sizes HOT 3
- Try to install in Angular 6 HOT 2
- How to add background-color for centre text ?
- Plugin called 60 times HOT 3
- Do not automatically register plugin HOT 1
- unable to sync label in center of donut with caption filtering HOT 1
- Chart JS Version 3++ HOT 2
- Issues updating label dynamically
- Display Total HOT 2
- Image not text?
- Help needed to use this plugin
- Chart JS version 4++
- Recalculate and update label text HOT 1
- Support virtual dimension values HOT 1
- Add support for dynamic text HOT 9
- Donut - Semi Circle Support?
- [Request] HTML Support in Label
- [Request] Font Awesome support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chartjs-plugin-doughnutlabel.