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

Y-Axis, always show tick for 0 value #1771

Closed
rafaoliverce opened this issue Jul 16, 2020 · 4 comments
Closed

Y-Axis, always show tick for 0 value #1771

rafaoliverce opened this issue Jul 16, 2020 · 4 comments

Comments

@rafaoliverce
Copy link

Is your feature request related to a problem? Please describe.
I need to always show the tick for zero value on the y-axis.

Describe the solution you'd like
Some option that could enforce the zero tick to show on the y-axis.

Describe alternatives you've considered
...

Additional context
image

@junedchhipa
Copy link
Contributor

You can use annotations to draw y-axis lines at specific points.
Take a look at this example - https://codepen.io/apexcharts/pen/GXOJXQ

annotations: {
  yaxis: [{
    y: 0
  }]
}

@rafaoliverce
Copy link
Author

Thanks @junedchhipa! The annotation works but it was not what I was searching for.

But I've found the solution!

For anyone with the same problem, what I needed to to was to use force nice scale true.
So even when the values goes negative, the 0 line will always appear.

@faridmovsumov
Copy link

@rafaoliverce can you please show an example code?

@rafaoliverce
Copy link
Author

@rafaoliverce can you please show an example code?

It's being a long time since I touched the chart I showed in the example so I'm not sure if it still works, but the options is this one:

yaxis: {
  ...
  forceNiceScale: true,
  ...
}

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

No branches or pull requests

3 participants