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 zeroLineWidth not working #6596

Closed
zhuhang-jasper opened this issue Oct 24, 2019 · 5 comments
Closed

Y-Axis zeroLineWidth not working #6596

zhuhang-jasper opened this issue Oct 24, 2019 · 5 comments

Comments

@zhuhang-jasper
Copy link

zhuhang-jasper commented Oct 24, 2019

Expected Behavior

Upon changing yAxes -> gridLines -> zeroLineWidth, y-axis thickness should change.

Current Behavior

Y-Axis will forever be width=1.

Steps to Reproduce (for bugs)

yAxes > gridLines > display: currently i set to false, even if set to true, it doesn't help.
yAxes > gridLines > zeroLineWidth: change to anything u like
https://jsfiddle.net/zhuhang95/sc6Lbtyv/5/

Context

I'm trying to make y-axis thicker, just like my x-axis.
And, I do not want to show gridLines for y-axis, I just want the zeroAxis to be thicker.

Environment

  • Chart.js version: 2.8.0
  • Browser name and version: Chrome 78.0.3904.63 (Official Build) beta (64-bit)
  • Link to your project: -
@kurkle
Copy link
Member

kurkle commented Oct 25, 2019

That was fixed in #6528, but is probably not quite what you are looking for.
There are number of other things in upcoming 2.9 that might help you get what you want: https://jsfiddle.net/nwrLphsq/1/

@zhuhang-jasper
Copy link
Author

That was fixed in #6528, but is probably not quite what you are looking for.
There are number of other things in upcoming 2.9 that might help you get what you want: https://jsfiddle.net/nwrLphsq/1/

That's quite close. U can set yAxes gridLines to false, will look better. Thanks

@kurkle kurkle closed this as completed Oct 31, 2019
@zhuhang-jasper
Copy link
Author

zhuhang-jasper commented Nov 1, 2019

@kurkle why is this closed? The issue is not fixed, there's only workaround which is not the intended behavior.

@kurkle
Copy link
Member

kurkle commented Nov 1, 2019

Because zeroLineWidth works as expected: https://jsfiddle.net/r74tmebh/
For category scale the zeroLine is considered to be first line (and for vertical, it defaults to starting from top - can be changed with reverse).

I think you are looking for a missing borderWidth in scale. If you alter the title, this can be reopened as enhancement.

@erickjrp
Copy link

erickjrp commented Jan 7, 2022

I don't understand, @kurkle , how can it be that this is working correctly? If I want the first (from bottom to top) horizontal grid to have some color and width, how can I do it? without using any workaround.

The idea is for zeroLineWidth and zeroLineColor to work as they do with the first vertical grid.

scales: {
        xAxes: [{
          gridLines: {
            zeroLineColor: 'black',
            zeroLineWidth: 2
          },
          display: true
        }],
        yAxes: [{
          gridLines: {
            zeroLineColor: 'black', // this does not work
            zeroLineWidth: 2 // this does not work
          },
          id: 'y-axis-0',
          display: true,
        }]
      }

If the value of the first element is not 0, zeroLineColor and zeroLineWidth are just not working.

And I don't want to use this (which "solves" the problem):

ticks: {
          beginAtZero: true
        }

Because I don't want the ticks to start at 0.

I'm using version 2.9.4.

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

3 participants