Hi the great sisense community, I need a lot of help on making a combo chart in Sisense. Below is what I want to create: The purpose of this chart is to show my main baseball team (Yankees) in b...
Let's make a few changes to the widget script, where we will detect the selected dashboard filters related to the first category item and then change the color and replace the xAxis text appropriately:
let myColor = "red"
widget.on('processresult', (w, args) => {
let categoryItem = widget.metadata.panels[0].items[0].jaql.dim
let myTeams = widget.dashboard.filters.item(categoryItem).jaql.filter.members
for (let i = 0; i < myTeams.length; i++) {
let myTeam = myTeams[i]
args.result.series[0].data.find((d) => { return d.selectionData[0] === myTeam }).color = myColor
}
for (let j = 0; j < args.result.xAxis.categories.length; j++) {
if (!myTeams.includes(args.result.xAxis.categories[j])) {
args.result.xAxis.categories[j] = ''
}
}
})
Secondly, lets make sure the widget filters behaviour is set to 'Highlight':
Hi Daniel! Thank you so much for your new script! It works wonderfully. I was able to achieve what I envisioned in the end product which is amazing! Two more things I'd love to knock down:
Can I make the gray bars to be #00ACCD? And the orange bar to be #F7921E?
I want to show the value labels of all bars (i.e. their %s). Is that another add to the script?