Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

how to color text of a dimension of a bar chart

Hello

I got a bar chart

it has a dimension called the release that has values v3.1.26, v3.1.27 tilll v3.1.31

I want to color these labels as follows:

v3.1.26 color(1)

v3.1.27 color(2)

and so on...

I went to axes tab and clicked on the font button insdie the dimension axis

and put the following expression Color(mid(Dim1,6,2)-(26-1))

however I only get black colored labels

Please advise

I can walk on water when it freezes
14 Replies
Gysbert_Wassenaar

The parentheses don't match. Perhaps you forgot a closing parenthesis at the end of the expression.


talk is cheap, supply exceeds demand
ali_hijazi
Partner - Master II
Partner - Master II
Author

I added the missing parenthesis and still doesn't work

I can walk on water when it freezes
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Axis Font colors are not calculated on a Dimension basis. It is calculated once for the chart outside the Dimensional context. So you can't vary the colors by Axis value.

-Rob

ali_hijazi
Partner - Master II
Partner - Master II
Author

why it doesn't work just as the pivot table?

I can walk on water when it freezes
veidlburkhard
Creator III
Creator III

Hi Ali,

do you want it like this?

ColorDim.jpg

Regards

Burkhard

ali_hijazi
Partner - Master II
Partner - Master II
Author

yes this is what I want

I can walk on water when it freezes
veidlburkhard
Creator III
Creator III

Hi Ali,

do it like this: add a new expression Only(dim1) and mark 'Text on Axis', but don't mark the 'Bar' check box. Also don't forget to uncheck the 'Legend' check box for your dimension dim1. See the pictures below

ColorDim.jpg

ColorDim2.jpg

At last set your expression Color(mid(Dim1,6,2)-(26-1)) into the 'Text Color' of your Only(dim1) expression.

That's all.

Hope this helps

Burkhard

ali_hijazi
Partner - Master II
Partner - Master II
Author

the problem is that I have two dimensions!!

I cannot use only(Dim1)

I can walk on water when it freezes
veidlburkhard
Creator III
Creator III

Hi Ali,

I added a second dimension and it worked same as with one dimension. See the picture:

ColorDim3.jpg

If you still have problems to get the result, please give me your data or qvw and I try to help...

Burkhard