merinsverghese
08-12-2024Cloud Apps
how to change the color of Tree map
I would like to change the default color of the tree map.
Hey merinsverghese ,
If you wanted to use a widget script to change individual item colors, you could use the following:
let colorConfig = [ { name: 'Alabama', color: '#ff0000' }, { name: 'Alaska', color: '#ff0000' }, { name: 'Arizona', color: '#ff0000' } ] widget.on('processresult', (w, args) => { let l = args.result.children.length for (let i = 0; i < l; i++) { let datum = args.result.children[i] let rule = colorConfig.find((rule) => { return datum.name === rule.name }) if (rule === undefined) { continue } datum.color = rule.color } })
with result:
Let me know how you go?
Thanks,
Daniel
RAPID BI
RAPID BI - Sisense Professional Services | Implementations | Custom Add-ons