Open alexandre-tobia opened 6 years ago
@alexandre-tobia offsetGridLines
also centers the values, so 2017 starts at the 2017 label.
@simonbrunel thoughts on a way to improve this?
@etimberg unfortunately yes...
so, in this case, the vertical line become totally useless (and meaningless ), maybe an option to avoid values to be automaticaly centered ?
This was also confusing me. Investigating further...
Got this working so that at least when I'm using the time scale for years, it splits the years with the grid lines and prints the year label in the middle of the year.
Here's an example that has been tested with Chart.js v2.7.3: https://gist.github.com/ahukkanen/fe69a70c3708b32210fd18860ba609c5
Is this a bug by the way or intended behavior? This was totally confusing to me at first before I found this issue.
Does not look like an issue in v3 anymore?: https://jsfiddle.net/n5dbt2ue/ Could be actually fixed in 2.9 already, did not test.
Edit: nevermind
Hi,
I'm using chartjs latest version (2.7.2).
I'm using
offsetGridLines: true
to center my xAxes label (2016, 2017,...), but since i use this options, my points are not in the right position.For example, this point need to be between the red lines (because it belongs to 2016)
jsfidle: https://jsfiddle.net/mrbmvd19/1/ (look at the 2016-12-01)
Do you know how to do that?
Thanks a lot.