Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Manoj_Prabu
Partner - Creator
Partner - Creator

Color Object in Properties panel

Hi Community,

Please share the way to include the color object to the properties panel in the custom extension. I'm trying to use the master dimension's color value in auto color mode. but couldn't find the proper way to integrate in the properties panel (like using qAttrExp).

Referred links:

https://help.qlik.com/en-US/sense-developer/August2022/Subsystems/Mashups/Content/Sense_Mashups/Crea...

Solved: Use master items COLORS in QSense Extension - Qlik Community - 1556421 - also please let me know how to get the colorMapRef value.

Labels (1)
1 Solution

Accepted Solutions
alex_colombo
Employee
Employee

Hi @Manoj_Prabu , below an example of extension definition for enabling colors and legend. Then you can use it reading the layout object

definition: {
	type: "items",
	component: "accordion",
	items: {
		dimensions: {
			uses: "dimensions",
			min: 1,
			max: 1
		},
		measures: {
			uses: "measures",
			min: 1,
			max: 1
		},
		sorting: {
			uses: "sorting"
		},
		settings: {
			uses: "settings",
			items: {
				colorsAndLegend: {
				uses: "colorsAndLegend",
				items: {
					legend: {
						items: {
							show: {
								snapshot: {
									tid: "property-legend"
								}
							}
						}
					}
				}
			}
			}
		}
	}
}

Then you can use it reading the layout object

2022-12-02 15_39_17-_ Test - Sample Data App - Il mio nuovo foglio (1) _ Sheet - Qlik Sense.png

About how to get the colorMapRef value, what is your doubt? The link you posted it should help you on this topic

View solution in original post

3 Replies
alex_colombo
Employee
Employee

Hi @Manoj_Prabu , below an example of extension definition for enabling colors and legend. Then you can use it reading the layout object

definition: {
	type: "items",
	component: "accordion",
	items: {
		dimensions: {
			uses: "dimensions",
			min: 1,
			max: 1
		},
		measures: {
			uses: "measures",
			min: 1,
			max: 1
		},
		sorting: {
			uses: "sorting"
		},
		settings: {
			uses: "settings",
			items: {
				colorsAndLegend: {
				uses: "colorsAndLegend",
				items: {
					legend: {
						items: {
							show: {
								snapshot: {
									tid: "property-legend"
								}
							}
						}
					}
				}
			}
			}
		}
	}
}

Then you can use it reading the layout object

2022-12-02 15_39_17-_ Test - Sample Data App - Il mio nuovo foglio (1) _ Sheet - Qlik Sense.png

About how to get the colorMapRef value, what is your doubt? The link you posted it should help you on this topic

Manoj_Prabu
Partner - Creator
Partner - Creator
Author

Hi @alex_colombo ,
Thank you for the response. Your solution literally saved most of my hours/days. This is what exactly that I expected.
About ColorMapRef, how to generate that ref id is my question. Once I added your solution, I got the ColorMapRef in the path - layout.qHyperCube.qDimensionInfo[0].qAttrDimInfo. but when I tried to get the layout as they said in the link, I didn't get the colors for the respective field. I'm expecting like - in the dimension "Year" for the field value "2022" it will return the master color value. Can you clarify my doubt regarding how to get those colors.


Apart from this question, I want to know how to use all the properties that used in Qlik sense default properties - like data as column instead of dimension & measure separately in the properties panel, like the one that you used above(colorsAndLegend). where to get the documentions for that?

Thanks & Regards,
Manoj Prabu

alex_colombo
Employee
Employee

Hi @Manoj_Prabu for your first question, if you are using default colors (no custom colors set), you have to use Theme API for understading which color will have you first/second/third/etc. dimension.
About all native properties, unfortunatley this is not documented