cancel
Showing results for 
Search instead for 
Did you mean: 

how to change the color of Tree map

merinsverghese
8 - Cloud Apps
8 - Cloud Apps

I would like to change the default color of the tree map. 

1 ACCEPTED SOLUTION

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:

rapidbisupport_0-1723526192803.png

Let me know how you go?

Thanks,

Daniel

RAPID BI

[email protected]

RAPID BI - Sisense Professional Services | Implementations | Custom Add-ons

View solution in original post

5 REPLIES 5

Helena_qbeeq
9 - Travel Pro
9 - Travel Pro

Hi @merinsverghese ,

As you can see here, to change the colors you need to configure either categories or a measure in the Colors data panel.

Please let me know if this works for you : )

Always here to help,
Helena from QBeeQ
[email protected]
QBeeQ - Gold Implementation and Development Partner

 

 

Any Script Available? If we want to use a color that is not available in the dashboard 'Color Pallet'. 

Regards,

Merin

DRay
Community Team Member
Community Team Member

Hi @merinsverghese,

You should be able to enter the hex code into the Custom field. https://docs.sisense.com/main/SisenseLinux/selecting-colors-in-widgets.htm

DRay_0-1723483862111.png

 

David Raynor (DRay)

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:

rapidbisupport_0-1723526192803.png

Let me know how you go?

Thanks,

Daniel

RAPID BI

[email protected]

RAPID BI - Sisense Professional Services | Implementations | Custom Add-ons

This Works, Thank you.

Regards,

Merin