Ngx-charts: Pie Charts - Override Label Threshold

Created on 18 Jun 2018  路  6Comments  路  Source: swimlane/ngx-charts

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

  • [ ] bug report - search github for a similar issue or PR before submitting
  • [ X] feature request
  • [ ] support request - use StackOverflow (add the ngx-charts tag) or the gitter chat for support questions

Current behavior
I understand as per design, labels are not shown below a certain threshold to avoid overlapping.

However, in some instances we could override this behaviour when only two values are shown in the chart.

Example below where we just show Online vs Offline devices:

screen shot 2018-06-18 at 14 05 59

What is the motivation / use case for changing the behavior?

Ability to show labels on minimum amount of values in a pie chart

Please tell us about your environment:
WebStorm, NPM

  • ngx-charts version: x.x.x
    8.0.1

  • Angular version: x.x.x
    6.0.2

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

All

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

Typescript 2.7.2

Accept PRs Backlog

Most helpful comment

@marjan-georgiev Do you did a release to 9.0.0 but I can't find this feature, any update. I have an stopper on my company for his feature. Thanks.

All 6 comments

Makes sense. I would add an input showLabelThreshold that accepts a number in the range [0, 100] indicating percentage of total value, above which the labels would be shown. Open for other ideas.

Thanks @marjan-georgiev . I think it's fair to have a number in a range, so we can adjust the threshold based on the parent container size and number of elements to render in the chart.

@marjan-georgiev Any plannig to release this PR. Thanks.

@marjan-georgiev Do you did a release to 9.0.0 but I can't find this feature, any update. I have an stopper on my company for his feature. Thanks.

would love this feature

Need this feature too! Duplicated issue #1284

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jacquers picture Jacquers  路  3Comments

stephanrauh picture stephanrauh  路  4Comments

cfremgen picture cfremgen  路  3Comments

faisalnet5 picture faisalnet5  路  3Comments

workfel picture workfel  路  3Comments