Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added condition to hide donut total label if hideLabel flag is set per issue #4370 #4516

Closed
wants to merge 3 commits into from

Conversation

halfpeeled
Copy link

New Pull Request

Summary of changes:

Added a condition to Pie.js so that donut chart total labels can display the total number without the label if desired. This is set by the flag hideLabel which can be passed as an option to the plotOptions.pie.donut.labels.total. This was motivated by this issue requesting the feature. I was not sure how to go about adding an additional test for this small change, but all existing tests still passed.

Fixes # 4370

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

@junedchhipa
Copy link
Contributor

Sorry for the delay here @halfpeeled
I am just thinking if the issue can be resolved without making change to the chart config (by checking if the name exists in total and then adjusting the y position).

@halfpeeled
Copy link
Author

Sure, that makes sense to me.

@junedchhipa
Copy link
Contributor

I have fixed the original issue in this commit based on your logic. Thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Donut chart Total
3 participants