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

Major and Minor grid lines #4933

Closed
itnassol opened this issue Nov 8, 2017 · 7 comments
Closed

Major and Minor grid lines #4933

itnassol opened this issue Nov 8, 2017 · 7 comments

Comments

@itnassol
Copy link

itnassol commented Nov 8, 2017

I have created a resistivity chart, and it pulls data from a MySQL databse, all look good.

However i need minor grid-lines on the Y-Axis, (So horizontally).
Any pointers would be good..

resistivity

@etimberg
Copy link
Member

etimberg commented Nov 9, 2017

@itnassol there is no easy way to add minor grid lines. Is the picture what you are trying to achieve?

@itnassol
Copy link
Author

itnassol commented Nov 9, 2017

hi there, No that's what I have achieved so far, but between each of the ticks, I really need 10 minor lines

@etimberg
Copy link
Member

etimberg commented Nov 9, 2017

One option is to generate more lines and then use y axis callback to hide the labels on everything that is not an integer step of the power of 10. Not sure how easy that is off the top of my head.

You might need a custom build that changes https://github.com/chartjs/Chart.js/blob/master/src/core/core.ticks.js#L100-L142

@itnassol
Copy link
Author

Thank you, Good idea, I will have a play, but Minor and Major ticks would be a good enhancement..

@etimberg
Copy link
Member

Going to close this. In v3 we have functional arguments for the grid line config options. That will allow a config that creates extra grid lines, then styles the major ones in a different way. Example https://www.chartjs.org/samples/master/scales/gridlines-scriptable.html

@kberg
Copy link

kberg commented Apr 10, 2022

Going to close this. In v3 we have functional arguments for the grid line config options. That will allow a config that creates extra grid lines, then styles the major ones in a different way. Example https://www.chartjs.org/samples/master/scales/gridlines-scriptable.html

Got a 404, https://www.chartjs.org/samples/master/scales/gridlines-scriptable.html not found.

@LeeLenaleee
Copy link
Collaborator

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