Ngx-charts: Line overflow over label in Polar chart

Created on 9 Aug 2017  路  6Comments  路  Source: swimlane/ngx-charts

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

Bug Accept PRs Backlog

Most helpful comment

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';"

All 6 comments

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';"

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

Any update ?

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

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

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

Was this page helpful?
0 / 5 - 0 ratings