Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
SebastianRichter
Contributor III
Contributor III

Change bar color by selection

Hi everyone,

I have a sheet with multiple bar charts. All bar charts have the same dimensions (user). Only the measure differ between each chart (chart 1 = count(LogIn), chart 2 = avg(TimeOnline) and so on). Now when I make a selection, let’s say select one user by a filter pane, I want the relevant bar in each chart to change the color instead of being selected by the filter. So I want all users to remain in the bar chart and just change the color of the bar for the user I selected.

Is there any way to do this?

Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

 

For example (with the test script)comm.gif

 

Expression :

Sum({<Dim1=>} Expression1)

Dim1= exclude Dim1 selection

Color expression : 

If(Only(Dim1)=Dim1 and GetSelectedCount(Dim1)>0, red(), blue())

 

Test script (crtl 00) :

Characters:
Load Chr(RecNo()+Ord('A')-1) as Alpha, RecNo() as Num autogenerate 26;
 
ASCII:
Load 
 if(RecNo()>=65 and RecNo()<=90,RecNo()-64) as Num,
 Chr(RecNo()) as AsciiAlpha, 
 RecNo() as AsciiNum
autogenerate 255
 Where (RecNo()>=32 and RecNo()<=126) or RecNo()>=160 ;
 
Transactions:
Load
 TransLineID, 
 TransID,
 mod(TransID,26)+1 as Num,
 Pick(Ceil(3*Rand1),'A','B','C') as Dim1,
 Pick(Ceil(6*Rand1),'a','b','c','d','e','f') as Dim2,
 Pick(Ceil(3*Rand()),'X','Y','Z') as Dim3,
 Round(1000*Rand()*Rand()*Rand1) as Expression1,
 Round(  10*Rand()*Rand()*Rand1) as Expression2,
 Round(Rand()*Rand1,0.00001) as Expression3;
Load 
 Rand() as Rand1,
 IterNo() as TransLineID,
 RecNo() as TransID
Autogenerate 1000
 While Rand()<=0.5 or IterNo()=1;

 Comment Field Dim1 With "This is a field comment";

 

 

Help users find answers! Don't forget to mark a solution that worked for you!

View solution in original post

1 Reply
Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

 

For example (with the test script)comm.gif

 

Expression :

Sum({<Dim1=>} Expression1)

Dim1= exclude Dim1 selection

Color expression : 

If(Only(Dim1)=Dim1 and GetSelectedCount(Dim1)>0, red(), blue())

 

Test script (crtl 00) :

Characters:
Load Chr(RecNo()+Ord('A')-1) as Alpha, RecNo() as Num autogenerate 26;
 
ASCII:
Load 
 if(RecNo()>=65 and RecNo()<=90,RecNo()-64) as Num,
 Chr(RecNo()) as AsciiAlpha, 
 RecNo() as AsciiNum
autogenerate 255
 Where (RecNo()>=32 and RecNo()<=126) or RecNo()>=160 ;
 
Transactions:
Load
 TransLineID, 
 TransID,
 mod(TransID,26)+1 as Num,
 Pick(Ceil(3*Rand1),'A','B','C') as Dim1,
 Pick(Ceil(6*Rand1),'a','b','c','d','e','f') as Dim2,
 Pick(Ceil(3*Rand()),'X','Y','Z') as Dim3,
 Round(1000*Rand()*Rand()*Rand1) as Expression1,
 Round(  10*Rand()*Rand()*Rand1) as Expression2,
 Round(Rand()*Rand1,0.00001) as Expression3;
Load 
 Rand() as Rand1,
 IterNo() as TransLineID,
 RecNo() as TransID
Autogenerate 1000
 While Rand()<=0.5 or IterNo()=1;

 Comment Field Dim1 With "This is a field comment";

 

 

Help users find answers! Don't forget to mark a solution that worked for you!