Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

How to increase the intensity of colour in SVG Reader for low values?

Hi,

I have created a US map, with few states in data. I want to show colour for these charts ranging from dark red (low population) to dark green(high population). I'm successful at getting dark green colour for high population but with low populations I only get faded red colour.

There exist one more issue too, that is I'm not able to set the state's name visible.

Can some one please give me a solution!

Im also attaching my data.

Note: I'm using trail version so I cant open your solution in  the form of ".qvw" file. Please explain your solution in text. Thanking you in advance.

Untitled2.pngUntitled1.png

1 Solution

Accepted Solutions
Highlighted
Master
Master

Re: How to increase the intensity of colour in SVG Reader for low values?

hahaha after all that all you actually needed to do was set your 'measure' to be 1!!!

Well that was a fun afternoon

Capture.PNG

View solution in original post

13 Replies
Highlighted

Re: How to increase the intensity of colour in SVG Reader for low values?

Note: I'm using trail version so I cant open your solution in  the form of ".qvw" file. Please explain your solution in text. Thanking you in advance.

That is ok, Send qvw so that we may work for your file and then we will share if we got solution for Bright Red color to Thick red color.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Master
Master

Re: How to increase the intensity of colour in SVG Reader for low values?

I think you will find that the fill opacity is controlled in the javascript of the extension.

I've just done a quick test and the colour seems to render OK for me, you could simplify your if statement as well by having one rather than two

Capture.PNG

Highlighted
Master
Master

Re: How to increase the intensity of colour in SVG Reader for low values?

Ok yes the code seems to be applying  some sort of scaling to the colours as I get the same issue as you.

This is nice in some ways but not when you want to hard-code, unfortunately to change it would require a change to the extension itself. This might not be too tricky but I don't have the mental capacity today!

Capture.PNG

Highlighted
Master
Master

Re: How to increase the intensity of colour in SVG Reader for low values?

Yeah here is the code it is using:

fill: v,  "fill-opacity": d / i + (1 - d / i) * .2,

So basically take the colour then alter the opacity based on the measure.

If you simply leave it hard-coded as 1 you get what you want:

Capture.PNG

You can overwrite the script in the extension folder with the one I have attached if you want this effect.

Please remember to mark this as helpful or the correct answer if I have helped you or answered your question.

This will help users identify the answers should they come across this thread in the future.

.2,

Highlighted
Master
Master

Re: How to increase the intensity of colour in SVG Reader for low values?

Ok so I found my brainpower so I tweaked the extension for you so you can set a default.

There is a new setting "Fixed Opacity (0 is off)" if this is set to 0 then it scales.

Here are some example settings:

Capture.PNG

Capture2.PNG

Capture3.PNG

Highlighted
Master
Master

Re: How to increase the intensity of colour in SVG Reader for low values?

hahaha after all that all you actually needed to do was set your 'measure' to be 1!!!

Well that was a fun afternoon

Capture.PNG

View solution in original post

Highlighted
Not applicable

Re: How to increase the intensity of colour in SVG Reader for low values?

That was too easy, thank you so much for your help

Highlighted
Master
Master

Re: How to increase the intensity of colour in SVG Reader for low values?

haha it only took me 2hrs of code to get there 😄

Highlighted
Not applicable

Re: How to increase the intensity of colour in SVG Reader for low values?

Do you know how to make the state names visible?

And now I have the original version. So, you can also reply with .qvw files