score:1

Accepted answer

i think your issue is with the following line:

const otherdatasetindex = ctx.datasetindex === 0 ? 1 : 0;

this will always use the first dataset to compare against. there are 6 total datasets and you want compare sets of two. the below code should fix this.

const otherdatasetindex = ctx.datasetindex % 2 === 0 ? ctx.datasetindex + 1 : ctx.datasetindex - 1;

this will compare all even datasets with the odd dataset just after it and all odd data sets with the even dataset coming before it in the array.


Related Query

More Query from same tag