frappe / charts

Simple, responsive, modern SVG Charts with zero dependencies
https://frappe.io/charts
MIT License
14.94k stars 718 forks source link

Update axis-chart-utils.js #282

Closed scottfr closed 4 years ago

scottfr commented 4 years ago

Fix issue with overlapping labels on series charts.

Explanation About What Code Achieves:

Fixes the series chart overlapping label issue here:

https://github.com/frappe/charts/issues/158

The issue was caused by the label overlapping logic only showing every Nth label. However N could change for each unique label length resulting in strange overlaps when the label length would change.

We now just choose one label length (the longest label) and use that throughout for spacing.

Screenshots/GIFs:

See here for a screenshot of the issue:

https://github.com/frappe/charts/issues/158

Steps To Test:

Create a series chart with labels that have a different number of characters. View before and after this change

TODOs:
coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 157


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

💛 - Coveralls