Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

fix(widgets/chart): remove panics with long axis labels #512

Merged
merged 2 commits into from Aug 1, 2021

Conversation

fdehau
Copy link
Owner

@fdehau fdehau commented Aug 1, 2021

Description

  • clamp the width of the first x axis label to not go above the width between the chart left border and the y axis.
  • clamp the width of all other x axis labels to not go above the width between each x axis tick.
  • clamp the width of all y axis labels to not go above 1/3 of the chart area.

Fixes #490

Testing guidelines

Checklist

@fdehau fdehau merged commit 8eb6336 into master Aug 1, 2021
@fdehau fdehau deleted the florian.dehau/chart-labels branch August 1, 2021 13:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wide labels (3 chars and more) in chart axis lead to panic with 'attempt to subtract with overflow'
1 participant