2👍
Solved issues by using the beginPath() method
ctx.beginPath();
ranges.forEach(function (range) {
var numbersBetween = range.end - range.start
ctx.fillStyle = range.color;
ctx.fillRect(_this.datasets[0].points[range.start].x - 0 * unitX, yTop, unitX * numbersBetween, yHeight);
})
ctx.fill();
Working fiddle below:
- [Chartjs]-Pie chart.js – show all 3 segment borders
- [Chartjs]-ChartJS: Limit label's length on an axis and show a tooltip on hover?
Source:stackexchange.com