Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
karolina_
Creator II
Creator II

Colors for scatter chart

Hi All,

I would like to color bubbles on scatter charts by metric chosen by user for example continent,country

Below there is a code to color first 10 that in put in expression -> background color:

if($(vDataName)='$(=$(vColorSelection(1)))',rgb(255,0,0),

if($(vDataName)='$(=$(vColorSelection(2)))',rgb(128,0,0),

if($(vDataName)='$(=$(vColorSelection(3)))',rgb(0,128,0),

if($(vDataName)='$(=$(vColorSelection(4)))',rgb(0,255,0),

if($(vDataName)='$(=$(vColorSelection(5)))',rgb(128,0,128),

if($(vDataName)='$(=$(vColorSelection(6)))',rgb(155,0,64),

if($(vDataName)='$(=$(vColorSelection(7)))',rgb(255,0,255),

if($(vDataName)='$(=$(vColorSelection(8)))',rgb(0,64,128),

if($(vDataName)='$(=$(vColorSelection(9)))',rgb(128,64,0),

if($(vDataName)='$(=$(vColorSelection(10)))',rgb(64,0,64)

,rgb(192,192,192))

)))))))))

where

vColorSelection -> SubField(concat(DISTINCT $(vDataName),'|'),'|',($1))

$(vDataName) -> Field Name

Some of the metrics has just 4 values some over 100. I would like to put it in the loop from 1 to GetPossibleCount($(vDataName)).

How can I do the loop in the chart? [I tried valueloop() but i had other dimension and it's not working correctly]

Thanks in advance

2 Replies
mov
Champion III
Champion III

(Not a solution, just an idea that may be helpful.)

It is easier to modify the color palette according your color list, and use color(n) function instead of rgb().  It easy to loop like this (10 colors in this example):

color(mod(RowNo(),10)+1)

There is a limit though, 18 colors in the palette.

Regards,

Michael

karolina_
Creator II
Creator II
Author

I was thinking of putting some variable and changing within the loop (that I dont have yet).
But nice tips always welcome and it's perfect for now.
Thank you Michael