Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
qluser01
Not applicable

How to accentuate a region in pie chart

Hello!

I have a pie chart with benchmarks, and I want to show the exact position of specific company in that benchmark.

I have something like this:

Here, 1 to 8 - titles

and I need to accentuate the region like:

that is a dot stating that this company is located here.

Or as a highlighted region:

How to do that in Sense?

1 Solution

Accepted Solutions
vlad_komarov
Not applicable

Re: How to accentuate a region in pie chart

The easiest way is to change the Color parameter to use "Color By Expression" option:

Screen Shot 2017-03-30 at 12.32.54 PM.png

In my sample QVF (attached), I am checking the company name and forcing system to use a bright color (RGB(255, 0, 0)) for this segment. All other segments are painted with dark colors...

if (index(company, district) >= 1, rgb(255, 0, 0), rgb(Rand()*90, Rand()*90, Rand()*90))

The result:

Screen Shot 2017-03-30 at 12.31.48 PM.png

This is a simplified way and you might have more complex structure to map the company to the district.

I am not sure what requirements do you have, but I am sure you can update this algorithm to use any other conditions to select your colors.

Regards,

Vlad

6 Replies
OmarBenSalem
Not applicable

Re: How to accentuate a region in pie chart

Can you share your sample app to directly work on it?

vlad_komarov
Not applicable

Re: How to accentuate a region in pie chart

The easiest way is to change the Color parameter to use "Color By Expression" option:

Screen Shot 2017-03-30 at 12.32.54 PM.png

In my sample QVF (attached), I am checking the company name and forcing system to use a bright color (RGB(255, 0, 0)) for this segment. All other segments are painted with dark colors...

if (index(company, district) >= 1, rgb(255, 0, 0), rgb(Rand()*90, Rand()*90, Rand()*90))

The result:

Screen Shot 2017-03-30 at 12.31.48 PM.png

This is a simplified way and you might have more complex structure to map the company to the district.

I am not sure what requirements do you have, but I am sure you can update this algorithm to use any other conditions to select your colors.

Regards,

Vlad

qluser01
Not applicable

Re: How to accentuate a region in pie chart

Here is my example (see attached file).

I need to paint the selected region as red on pie chart (see color by expression), can you help me to do that?

It works when I select Response filed (click with a mouse)

But i need it to work when I select CLnum row in table.

UPDATE: solved it.

see attach.

samane_ramezani
Not applicable

Re: How to accentuate a region in pie chart

PIE CHART.png

OmarBenSalem
Not applicable

Re: How to accentuate a region in pie chart

You just add it to you color expression:

if ( GetFieldSelections(Response) = Response or GetFieldSelections(CLnum) = CLnum  , rgb(255, 0, 0), rgb(87, 87, 87))

Capture.PNG

qluser01
Not applicable

Re: How to accentuate a region in pie chart

oh, nice move, thanks ))