Reputation: 3625
My current project needs to show this kind of graphics chart.
Most of the time a Bar
element is at the middle of 2 vertical grid lines, but in my case, it should be at the center of 1 vertical grid line.
I searched sample codes and API documents, but I couldn't find a solution for my case.
Is it possible to draw this kind of chart with Chart.js?
Upvotes: 0
Views: 1223
Reputation: 91
Did you tried to set gridLines.offsetGridLines to false? It should be working fine. Check out the documentation here: https://www.chartjs.org/docs/latest/charts/bar.html#scale-configuration
options: {
scales: {
xAxes: [{
gridLines: {
offsetGridLines: false
}
}
}
}
Upvotes: 1