Issue in styling legend in Pie charts
See original GitHub issueHi All,
I’m trying to style my pie chart as first image below. But with below code I’m getting as shown in second image. Even I tried the solution as mentioned here 2253. Then no legends are displayed. Also I don’t want white border between pies.
I’m using ChartJs 2.4.0 version. Please help me in resolving the issue.
var legend = chartInstance.generateLegend();
document.getElementById("legend").innerHTML = legend;

Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
pie chart legend position issues - Google Groups
The legend is placed at the top since it is lengthen when you have lots of items, so aligning it to the center...
Read more >How to resolve Legends formatting Issue in SSRS pie Chart
If you are trying to have same legend text value, then try this, Right click on Series (in char data box) ---> Series...
Read more >How to set the legend of a pie chart right - Mendix Forum
Hello everyone, I'm facing an issue with the pie-chart legend. It overlaps at the border (see 130) and I haven't had any success...
Read more >Pie Chart Legend Height Issue - PTC Community
Hello, I placed a Pie Chart in a Responsive container, but the Height of the Legend takes around 30-40% of the container; how...
Read more >How to customize legendShape and can we apply styles to ...
2) I need to style legends using flex or any css property how to arrange two legends in columns.. 3)in pie chart I...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

A solution with an independent legend
Controller
Use your chart conf to create a list of legend items with color & label :
(it’s coffee script, use http://js2.coffee/ if you want a translation)
Template
Loop on legend items to display them and you can do whatever you want with styles
Result
You should see something like that
Thanks @etimberg. Issue resolved.