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':
Amazing! Thank you so much Daniel! Your scripts works wonderfully! I was able to produce what I envisioned. Two more things, is there a way to make the gray bars to appear as #00ACCD and the orange bar to appear as #F7921E? I'd like to show the value labels of all the bars (i.e. their %'s). Is that another thing that needs to be added to the script?