Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
ksmith24
Contributor III
Contributor III

ColorMix in svgMap Color Expression

Does anyone know if the ColorMix function is supported in the svgMap extension object?

Am attaching a simple QVW with expenses by country.

Am successfully using the ColorMix function as the background color within a straight table.

But it doesn't seem to work in the svg Map object.

Have a duplicate map that simply uses red() as the color, and that works.

Any ideas?

1 Solution

Accepted Solutions
rbecher
MVP
MVP

Hi Keith,

you could patch the result to RGB(), if the alpha factor (opacity) is constant 255 (from 2nd and third ColorMix1 parameter):

replace(

ColorMix1 ((1+Sign(2*(sum(Expense)-RangeMin (top(total sum(Expense),1,NoOfRows(total))))/(RangeMax (top(total sum(Expense),1,NoOfRows(total)))-RangeMin (top(total sum(Expense),1,NoOfRows(total))))-1)*Sqrt(Fabs((2*(sum(Expense)-RangeMin (top(total sum(Expense),1,NoOfRows(total))))/(RangeMax (top(total sum(Expense),1,NoOfRows(total)))-RangeMin (top(total sum(Expense),1,NoOfRows(total))))-1))))/2, ARGB(255, 0, 255, 0), ARGB(255, 255, 0, 0))

,'ARGB(255,','RGB(')

- Ralf

Astrato.io Head of R&D

View solution in original post

3 Replies
Not applicable

I suspect the SVG extension directly assigns color as standard SVG attribute without any parsing. Syntax for SVG color attribute is here http://www.w3.org/TR/SVG/types.html#DataTypeColor

My guess it should support rgb() syntax which in this case is standard CSS syntax, not QlikView's. ColorMix is purely QlikView's function and is not present in SVG standard syntax.

rbecher
MVP
MVP

Hi Keith,

you could patch the result to RGB(), if the alpha factor (opacity) is constant 255 (from 2nd and third ColorMix1 parameter):

replace(

ColorMix1 ((1+Sign(2*(sum(Expense)-RangeMin (top(total sum(Expense),1,NoOfRows(total))))/(RangeMax (top(total sum(Expense),1,NoOfRows(total)))-RangeMin (top(total sum(Expense),1,NoOfRows(total))))-1)*Sqrt(Fabs((2*(sum(Expense)-RangeMin (top(total sum(Expense),1,NoOfRows(total))))/(RangeMax (top(total sum(Expense),1,NoOfRows(total)))-RangeMin (top(total sum(Expense),1,NoOfRows(total))))-1))))/2, ARGB(255, 0, 255, 0), ARGB(255, 255, 0, 0))

,'ARGB(255,','RGB(')

- Ralf

Astrato.io Head of R&D
Not applicable

Thank you Ralf that worked as prescribed!