I created a JSFiddle with rounded chartJs bar corners: https://www.jsfiddle.net/gcb1dyou. The issue arises when the legend is clicked to filter data, causing the rounded corners to disappear as shown in the image below: https://i.sstatic.net/8NOMa.png
When I click the orange label, you can see that the rounded borders disappear on the yellow bar.
var lastVisible = 0;
for (var findLast = 0, findLastTo = this._chart.data.datasets.length; findLast < findLastTo; findLast++) {
if (!this._chart.getDatasetMeta(findLast).hidden) {
lastVisible = findLast;
if (this._chart.data.datasets[findLastTo - 1].data[this._index] == 0) {
lastVisible -= 1;
}
}
} I attempted to add another if statement to make lastVisible equal to findLast-1 when the data is hidden (legend clicked) and the previous index is null, but it didn't work
else{
if(this._chart.data.datasets[findLastTo - 1].data[this._index] == 0){
lastVisible=findLastTo-2;
}
}
How can I resolve this issue? I look forward to hearing your solutions.