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

Question: how to calculate padding automatically? #711

Open
alexey-milovidov opened this issue Jun 18, 2022 · 2 comments
Open

Question: how to calculate padding automatically? #711

alexey-milovidov opened this issue Jun 18, 2022 · 2 comments
Labels
question Further information is requested

Comments

@alexey-milovidov
Copy link
Contributor

I do this:

padding: [ null, null, null, (Math.ceil(Math.log10(Math.max(...json[1]))) + Math.floor(Math.log10(Math.max(...json[1])) / 3)) * 6 ],

But it does not feel natural.

@leeoniya
Copy link
Owner

can you elaborate on the use case?

i'm assuming you're trying to get something like this: https://leeoniya.github.io/uPlot/demos/axis-autosize.html

(related to rendering long tick values in #713)

@leeoniya leeoniya added the question Further information is requested label Jun 19, 2022
@alexey-milovidov
Copy link
Contributor Author

Yes, thank you for pointing to this example. Looks like exactly what I need!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants