Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Label inside donut chart

Open jomarmen opened this issue 13 years ago • 85 comments

Hi,

I would like to be able to add a label inside a donut chart like this charts

lnDId

Thks

jomarmen avatar Apr 17 '13 10:04 jomarmen

me too +1

helmund avatar Apr 22 '13 15:04 helmund

+1

battaglr avatar Apr 26 '13 19:04 battaglr

+1

ax003d avatar May 08 '13 08:05 ax003d

+1

dibba avatar Jun 04 '13 02:06 dibba

+1

michelreyes avatar Jun 04 '13 16:06 michelreyes

Would putting this data in an HTML absolutely positioned element over the top of the doughnut not be a better solution than adding more to chart.js to achieve this?

nnnick avatar Jun 05 '13 21:06 nnnick

+1

fizerkhan avatar Jun 12 '13 16:06 fizerkhan

It's fairly easy to do this with HTML, but it would be nice if the chart exposed some sort of event API to hook into to populate the value.

jcutrell avatar Jul 07 '13 01:07 jcutrell

+1

bissy avatar Jul 10 '13 05:07 bissy

+1

SteveD11 avatar Jul 18 '13 15:07 SteveD11

+1

Although, as well as a label I think it would also be good to have it auto add the sum-total of the data put in, or the data type etc

I may work on a way to pass this in if I get the chance this week, though doing the total automatically shouldn't be too much of a stretch.

J5Dev avatar Jul 20 '13 13:07 J5Dev

+1

deanhume avatar Aug 16 '13 14:08 deanhume

is there any option to write label for each section?

ghost avatar Jan 02 '14 08:01 ghost

+1

Yes, this can be accomplished easily with HTML, but I would love to see something like this implemented into the core.

erikthedeveloper avatar Jan 09 '14 17:01 erikthedeveloper

+1

joetime avatar Jan 09 '14 19:01 joetime

+1

carlosrymer avatar Feb 19 '14 20:02 carlosrymer

+2

hutber avatar Mar 09 '14 22:03 hutber

+3

marcj avatar Mar 09 '14 23:03 marcj

-1 I think the HTML approach is better. The label will only make sense inside the canvas if it is very small.

I would consider these to be a special-purpose of pie chart: single value pie charts with label in the middle.

Recommending implementation should be outside chart.js

fulldecent avatar Sep 15 '14 16:09 fulldecent

@fulldecent The advantage to having a label/legend built into the chart is that the user can take the image itself and use it in another doc or presentation without having to re-create the legend. In fact, for my users, this is an absolute requirement - a chart without a legend is useless to them. Whether that should be within the scope of chart.js is debatable, but I would guess there are many devs that would agree with me on this one. I could be wrong though.

joetime avatar Sep 15 '14 17:09 joetime