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

[FEATURE] Zero Line Offset #5038

Closed
lloydkeijzer opened this issue Dec 11, 2017 · 3 comments
Closed

[FEATURE] Zero Line Offset #5038

lloydkeijzer opened this issue Dec 11, 2017 · 3 comments

Comments

@lloydkeijzer
Copy link

lloydkeijzer commented Dec 11, 2017

I would like to request a feature for adjusting the offset at which the y-axis zero line is drawn in a Line chart.

Current Behavior

The position of the y-axis zero line is now based on the length of the values. For example a graph with a max value of 100 is drawn further to the right than a chart with a max value of 10:

chart 1:
100|
chart 2:
10|

Possible Solution

chart 1: 
100 |
chart 2: 
10  |  <-- adjusted or fixed y-axis zero line offset
@lloydkeijzer
Copy link
Author

UPDATE:
After researching a bit more, I discovered this beauty

yAxes: [{
    afterFit: (scaleInstance) => {
        // eslint-disable-next-line no-param-reassign
        scaleInstance.width = 60;
    },
}],

This will align all zero line offsets. But this method has a drawback when the yLabel does not fit within the given width they won't show. Is there a better solution for this?

@jcopperfield
Copy link
Contributor

@lloydkeijzer Maybe some of the ideas in this issue are applicable #4982

@nagix
Copy link
Contributor

nagix commented Jun 3, 2019

Duplicate of #4340

@nagix nagix marked this as a duplicate of #4340 Jun 3, 2019
@nagix nagix closed this as completed Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants