Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qluser01
Creator
Creator

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
Partner - Specialist III
Partner - Specialist III

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

View solution in original post

6 Replies
OmarBenSalem

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

vlad_komarov
Partner - Specialist III
Partner - Specialist III

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
Creator
Creator
Author

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.

Anonymous
Not applicable

PIE CHART.png

OmarBenSalem

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
Creator
Creator
Author

oh, nice move, thanks ))