ngx-charts icon indicating copy to clipboard operation
ngx-charts copied to clipboard

Line overflow over label in Polar chart

Open bagbyte opened this issue 7 years ago • 7 comments

I'm submitting a ... (check one with "x")

[X] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior

In some cases, one line on the Polar chart type is overflowing over the label.

Expected behavior

All the lines should stop right before each label.

Reproduction of the problem

const data = [
              {
                name: 'Sales',
                series: [
                  {name: 'Label A', value: 13020286.77},
                  {name: 'Label B', value: 5849129.05},
                  {name: 'Label C', value: 596483.73},
                  {name: 'Label D', value: 138544.59},
                  {name: 'Label E', value: 452095.72},
                  {name: 'Label F', value: 398695.48},
                ]
              }
            ];

schermata 2017-08-09 alle 14 27 18

There is an overflow on the Label D

Please tell us about your environment:

  • OS: Mac OSX 10.12.5 | Ubuntu 14.10
  • ngx-charts version: 6.0.1
  • angular-cli version: 1.2.1
  • Angular version: 4.2.6
  • Browser: Chrome 60.0.3112.90
  • Language: TypeScript 2.4.1 | ES5

bagbyte avatar Aug 09 '17 12:08 bagbyte

Hi all,

Found the (possible) bug. The equal sign is missing. Under pie-label.component.ts textAnchor(), it should be "return this.midAngle(this.data) <= Math.PI ? 'start' : 'end';"

style-x7 avatar Dec 05 '17 10:12 style-x7

Hey, would love to get this fixed. Thank you!

CarlosAmaral avatar Dec 05 '17 12:12 CarlosAmaral

Any update ?

jobam avatar Sep 25 '18 12:09 jobam

Will this be fixed any time soon? Just to give some extra information: It only occurs with 6 labels.

jmeijer-jupe avatar May 15 '19 12:05 jmeijer-jupe

Hi, Any update? It occurs with 4 labels as well.

mayankshrm77 avatar Apr 20 '20 12:04 mayankshrm77

This is an ugly fix but it works You need to disable css encapsulation by adding encapsulation: ViewEncapsulation.None to @Component({...}) and add this to your css

.pie-label {
  transform: translateY(10px);
}

You can basically style the labels however you want

esidate avatar Aug 19 '20 20:08 esidate

This still is an issue and happens to me whenever I have an even number of labels. Tested with the latest version of ngx-charts (20.5.0)

gleitschirmjaeger avatar Dec 05 '23 08:12 gleitschirmjaeger