-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
First and last ticks align left right on x axis #7257
Comments
You can replace the generated ticks with your own ticks in |
Can someone explain how to use |
I think this would require updating the positions but the data structures to update are internal ( |
@etimberg This task is actually bigger than it looks. It will require to update the next:
I probably will create an extension for this task soon. But would be nice if this will be available as an option in chart.js in the future out of the box. |
Configurable using new |
@etimberg This feature (at the moment, the name of this setting has been changed from "alignment" to "align") works for whole axis ticks and unfortunately not able to set first tick to "start" align and last tick for "end" align simultaneously. |
I was trying to solve similar issue with labels (I assume that Since Labels are calculated and drawn in the same function The only way is to pre-calculate those items (function takes those item from scale if possible) So the minimal solution that worked for me was to have
I was surprised that Overall I'd be happy to see better solution from someone :) |
Implementing new align type for X axis in progress: |
Is it possible now to position first tick on start and last tick on end ? |
Yes. You are looking for align = 'inner' in axis options https://www.chartjs.org/docs/latest/axes/cartesian/_common_ticks.html |
Hi, what is the best way to align first tick on x axis to the left? So tick text starts on same level where chart begin to draw. And align last tick to the right? So text ends where chart ends. While at the same time distance between ticks must be equal. Example:
The text was updated successfully, but these errors were encountered: