6👍
✅
You can switch out the colors array with a doubly-linked list.
Or just use an anonymous function on the object creation,
datasets: [{backgroundColor: (() => {
let bgcolors = [];
for (let i=0; i < tickers.length; ++i) bgcolors.push(colors[i % colors.length]);
return bgcolors;
})()
}]
Source:stackexchange.com