Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

want to add expresion for my color.

I want to add custom in my Color lable in my qlik sense extension.(I want to sue "by expresion"). Can someone help me

1 Solution

Accepted Solutions
bill_markham

I have downloaded it, had a look and it seems that you need to create a second expression and in that do your colour expression:

With some test data I used this expression :

    if ([Obesity %] > 20 , red() , yellow() )

And it coloured the bubbles as per the expression.

You will need an expression as per your data model and needs.

It does allude to this in the description on both Branch and GitHub.  Albeit a bit obliquely.

Measure 2 (optional): This measure allows you to define a custom color based on the dimension and measure data. For example, you could create a measure that colors the bubbles red when they pass a certain threshold, but blue otherwise.

This is the bit in gridchart.js starting line 123 that adds the circles and the last line pasted below controls the colour should you wish to customise it.

// Add the circles

var circles = svg.selectAll(".circles")

   .data(data)

   .enter()

   .append("circle")

   .attr("class","circles")

   .attr("cx",function(d) {return x(d.Dim1) + x.rangeBand()/2;})

   .attr("cy",function(d) {return y(d.Dim2) + y.rangeBand()/2;})

   .attr("r",function(d) {return r(d.Value)})

   .attr("fill",function(d) {return d.InputColor == "N/A" ? user_prop.value : ARGBtoRGBA(d.InputColor);});

View solution in original post

10 Replies
Not applicable
Author

Hi Juthika.

You can use the functions rgb() or argb(), they will both return colors and you can use any color picker to find the values you like.

Not applicable
Author

Hi Juthika,

I didn't got what exactly you want to say.

But I have done a demo with using color 'by Expression'.

Expression I have used is mentioned below,

if(count2>'0' and count2<5,rgb(100,200,150),if(count2>='6' and count2<9,rgb(150,50,70),rgb(10,20,50)))

kindly check.

Not applicable
Author

I am using a extesion chart called "grid Chart". I dont see this "Custom " in color. How can I add that in my java script from back end.

bill_markham

Is this the extension on Qlik Branch you are using GitHub - skokenes/Qlik_Sense_Extension-GridChart: A grid chart for Qlik Sense ?

Not applicable
Author

Yes, this is the one I am using.

bill_markham

I have downloaded it, had a look and it seems that you need to create a second expression and in that do your colour expression:

With some test data I used this expression :

    if ([Obesity %] > 20 , red() , yellow() )

And it coloured the bubbles as per the expression.

You will need an expression as per your data model and needs.

It does allude to this in the description on both Branch and GitHub.  Albeit a bit obliquely.

Measure 2 (optional): This measure allows you to define a custom color based on the dimension and measure data. For example, you could create a measure that colors the bubbles red when they pass a certain threshold, but blue otherwise.

This is the bit in gridchart.js starting line 123 that adds the circles and the last line pasted below controls the colour should you wish to customise it.

// Add the circles

var circles = svg.selectAll(".circles")

   .data(data)

   .enter()

   .append("circle")

   .attr("class","circles")

   .attr("cx",function(d) {return x(d.Dim1) + x.rangeBand()/2;})

   .attr("cy",function(d) {return y(d.Dim2) + y.rangeBand()/2;})

   .attr("r",function(d) {return r(d.Value)})

   .attr("fill",function(d) {return d.InputColor == "N/A" ? user_prop.value : ARGBtoRGBA(d.InputColor);});

View solution in original post

Not applicable
Author

For me all the time I am getting yellow colored boubble when used the expression. What is this "Obesity". Then how can I color the bubble as  yellow when it is 1 other wise blue

Not applicable
Author

I  used  the level of the measure for color expression, and it worked. Thank you so much for your help.

bill_markham

Glad you are ok now.

[Obesity %] was a field from my test data model.