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

feat: added truncateLegends options #234

Merged
merged 1 commit into from
Jul 21, 2019

Conversation

scmmishra
Copy link
Contributor

@scmmishra scmmishra commented Jul 20, 2019

Explanation About What Code Achieves:
  • Long legends would overlap with neighboring legends as shown in the screenshot below, added an option which when enabled, would truncate the legends.
Changes in the PR.
  1. Added truncateString in draw-utils.js
  2. Added truncateLegends options to config object and passed it along to legendBar in AxisChart.js
  3. Added a default value for max number of characters LABEL_MAX_CHARS in draw.js

NOTE: The default value for truncateLegends is 0 (i.e. false)

Screenshots/GIFs:

truncateLegends not set (or set to false)
Screenshot 2019-07-20 at 10 08 21 PM

truncateLegends set as true
Screenshot 2019-07-20 at 10 08 54 PM

@coveralls
Copy link

coveralls commented Jul 20, 2019

Pull Request Test Coverage Report for Build 102

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 38.158%

Totals Coverage Status
Change from base Build 100: 0.0%
Covered Lines: 29
Relevant Lines: 62

💛 - Coveralls

@harshit-30
Copy link

harshit-30 commented May 22, 2020

Was this fixed just for Bar charts?

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.

None yet

3 participants