- I'm trying to set max/min for y-axis in my horizontal bar graph.
- The result (image/pen below) shows that setting min/max for y-axis works but the ticks of min/max are not placed at the start/end of y-axis.
- As you can see, my min/max are 1450/1810 and they are not shown at the bottom/top grid lines of y-axis.
- I guess bars have width and ticks are placed at the middle of the bars. I my code, line and scatter graphs are fine but bar graphs.
- This is my codepen link:
https://codepen.io/hoai-nguyen/pen/mdWMBeO
y: {
grid: {
offset: false,
},
ticks: {
align: 'end',
},
position: 'right',
type: 'linear',
min: 1450,
max: 1810,
// suggestedMax: 1810,
// suggestedMin: 1450,
ticks: {
min: 1450,
max: 1810,
},
barStart: 1450,
title: {
display: true,
text: "Y-name",
color: "blue",
font: {
family: "Calibri Light",
size: 12,
weight: 'bold',
},
},
},
- Please take a look and any suggestion would be appreciated!
min/max ticks are not in the bottom/top gridlines
Line/Scatter graphs are fine but Bar graphs
Note: I'm using the version 3.3.2 of chart.js