I'm trying to implement custom hover method. In my case I need to change color not only on hovered bar but also on some previous elements. For example when I hover on 29.04 I need to color this and previous 23.04. Code below not working :( help me please.
hover: {
onHover: function(event, activeElements: any): void {
if (activeElements.length) {
const indexes = [];
for (let index = activeElements[0]._index; index > 0; index = index - 6) {
indexes.push(index);
}
this.getDatasetMeta(0).data.forEach(function(ele) {
if (indexes.includes(ele._index)) {
ele._view.backgroundColor = CONSTANTS.COLORS.HIGHLIGHT;
}
});
this.update();
}
},
}