Qlik Community

QlikView Extensions

Discussion Board for collaboration on QlikView Extensions.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

ksmith24
Not applicable

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
Not applicable

Re: ColorMix in svgMap Color Expression

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

3 Replies
Not applicable

Re: ColorMix in svgMap Color Expression

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
Not applicable

Re: ColorMix in svgMap Color Expression

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

Not applicable

Re: ColorMix in svgMap Color Expression

Thank you Ralf that worked as prescribed!