You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last tick's label may be clipped (text appears outside of plotting area). This happens when splits' last element calculated too close to the series last element and provided options.padding is not enough to fit text. This issue appears quite rare, but anyway it's pretty annoying.
Unconditionally increase corresponding padding. This will fix the problem but it will take a lot of usable space as well, and 99 out of 100 times it's just useless.
Try to get splits by incrs and manually calculate required and available space and increase padding when it's necessary. This will fix the problem only when it appear and will save space when there's no need for padding increase. But I think it's kind of overcomplicated and also that's not very good to have a lot of charts with inconsistent paddings on same page (imagine a dashboard of charts with a bunch of different padding 🤢)
Don't render labels on canvas, but write a plugin to render labels as HTML elements. Seems that it will work and provide much more control for rendering. But it looks like sledgehammer to crack a nut to me.
All given workarounds have significant disadvantages, so I thought maybe you have opinion on this case, like you know, Highcharts for instance trying to align every label in such way to fit into plotting area, or something like this. At current point the best thing I decided to do is to do nothing :)
The text was updated successfully, but these errors were encountered:
the internals of this are actually quite complex/ungreat, and i want to refine them soonish.
the problem here is chicken-egg, since plotting area size (and padding and axis size) is affected by rendered tick values but the ticks which are rendered depend on the plotting area size + scale range. solving both things in a single pass is not possible, so uPlot has to run both functions twice until it converges on some solution that satisfies both somehow.
Hi @leeoniya
I faced with issue and I'd like to discuss it
The problem:
The last tick's label may be clipped (text appears outside of plotting area). This happens when splits' last element calculated too close to the series last element and provided
options.padding
is not enough to fit text. This issue appears quite rare, but anyway it's pretty annoying.Simple example here: https://codesandbox.io/p/sandbox/test-uplot-nz5rcy?file=%2Findex.html
Workarounds:
Unconditionally increase corresponding padding. This will fix the problem but it will take a lot of usable space as well, and 99 out of 100 times it's just useless.
Try to get
splits
byincrs
and manually calculate required and available space and increase padding when it's necessary. This will fix the problem only when it appear and will save space when there's no need for padding increase. But I think it's kind of overcomplicated and also that's not very good to have a lot of charts with inconsistent paddings on same page (imagine a dashboard of charts with a bunch of different padding 🤢)Don't render labels on canvas, but write a plugin to render labels as HTML elements. Seems that it will work and provide much more control for rendering. But it looks like sledgehammer to crack a nut to me.
All given workarounds have significant disadvantages, so I thought maybe you have opinion on this case, like you know, Highcharts for instance trying to align every label in such way to fit into plotting area, or something like this. At current point the best thing I decided to do is to do nothing :)
The text was updated successfully, but these errors were encountered: