This is the way that I load data to the "userFilterData" array.
Code: Select all
let userFilterData = [
'printChart',
'downloadPNG',
'downloadJPEG',
'downloadPDF',
'downloadSVG',
'separator', // Separator između standardnih opcija i prilagođenih opcija.
];
data.users.forEach(function (user) {
colors[user.login] = getRandomHexColor();
userFilterData.push({
text: user.fullName,
onclick: function (ctx) {
this.series[0].data.forEach(point => {
// Check if the point matches to button innerHTML target value.
if (point?.owner !== ctx.target.innerHTML) {
point.update({
visible: false
})
} else {
point.update({
visible: true
})
}
})
}
});
});
Code: Select all
point: {
events: {
click: function (e) {
e.point.update({
visible: false
}, true, false)
}
}
}