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

[FEATURE] Labels outside the pie chart

Open Omiod opened this issue 9 years ago • 9 comments

Expected Behavior

I'd like to have the labels outside the chart, like this example, taken from the deprecated Google Image Charts library: chart

Current Behavior

So far legend is the only way to describe the chart areas, and tooltips do not replace this feature.

  • Chart.js version: latest

Omiod avatar Dec 07 '16 15:12 Omiod

I'm not sure if this should live in the core or if it should exist as some kind of plugin. @chartjs/maintainers thoughts?

etimberg avatar Dec 07 '16 23:12 etimberg

@etimberg I think this is something that should live in the core. It would be too much work to maintain it as a separate plugin and could easily be included with the core.

panzarino avatar Dec 08 '16 02:12 panzarino

Anyone managed to do it? ;)

HugoHeneault avatar Aug 31 '17 15:08 HugoHeneault

+1, fixes ugly charts like this one. chart

rebsgroup avatar Oct 10 '17 13:10 rebsgroup

This feature should now be requested in the chartjs-plugin-datalabels repository: it already allows to add labels outside the chart but it doesn't support links.

simonbrunel avatar Dec 05 '17 17:12 simonbrunel

is that works with funnel chart using plugin called chart js funnel plugin

Cristianopavan avatar Jul 05 '18 10:07 Cristianopavan

In my scenario, the charts are in a wide-format canvas. In this scenario, the GoogleChart implementation has the nice effect of placing the labels intelligently left and right of the chart and connecting label and slice via line, providing the full height of the canvas to the chart.

This can (to my knowledge) not be done with the chartjs-plugin-datalabels and neither with other plugins I found. Just placing the legend around the pie shrinks the chart even further, which I do not want.

Is there some other plugin that I missed and that can display the legend as shown in the first picture? Or how should one proceed here?

DrNiels avatar Jul 23 '18 14:07 DrNiels

https://rawgit.com/beaver71/Chart.PieceLabel.js/master/build/Chart.PieceLabel.min.js use this link to get label out side for pie chart @DrNiels

Cristianopavan avatar Jul 26 '18 06:07 Cristianopavan

@Cristianopavan I actually use that plugin to put labels onto the slices, but it does not place the labels for the slices left and right of the chart but always directly at the slice. Consider the label of "February" in the screenshot of the first post. Since the canvas is wide, the label is placed left of the chart and connected with a line. That's what I want.

DrNiels avatar Jul 26 '18 07:07 DrNiels