Fix x-axis label rendering partially off the side of the chart when it is too long #215

wants to merge 2 commits into


None yet

2 participants


I have found that when an time-axis label doesn't fit between its graticule and the edge of the chart, the label dangles off the side of the chart. Here is an illustration:


This commit enhances the time axis so that it does not render the label if it will not fit on the chart:


Note that it removes the label after adding (instead of preventing it from being added) because I have read that you cannot reliably find an element's width before it is added to the DOM.


So you detect when it's outside of the chart, why not flip it to the other side?


I don't think I understand this comment. Wouldn't a graticule label be misleading if you rendered it some place other that should be?


@mbooth101, yes, yes it would, I misread. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment