Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create multiple text values on Bar Chart

I keep getting asked this question and have been unable to find an acceptable working solution.

We have a bar chart that has two dimensions (entity and rating). We have one expression for the count.  The bar charts are stacked. I've attached a picture for reference.

The question we keep getting asked is can we have the percentage relative to one of the ratings along with the total number. In other words, if entity "ABC" has 100 Pass ratings and 5 Marginal Rating and 10 Fail Ratings, the user would like to see the total count and the percentage of fails next to each bar on the chart. So the display for this entity would show for example "115 / 8.70%".

Obviously, we can create tables of numbers that show this information, but the users want the visual appeal of the chart with the number right there and not have to look around or try to associate line 1 with line 1 from a text grid, etc...

52 Replies
Not applicable
Author

That's what I thought also, but the individual said he tested it

=======================

Sum ([Sample Count]) & 'XXXX'  << its a string

You can't plot string value on numeric axis

Not applicable
Author

So to be clear - if I use dual in the expression and turn the option for "Text on Axis" on the stacked bars will appear correctly, the text will just be outside the chart on the axis - correct?

If that is correct, it might be an option, they will not like it, but we might be able to sell it as am option for a little while.

Not applicable
Author

I am reporting the problem with Dual as a bug, but unsure what kind of response I will receive

whiteline
Master II
Master II

yeah, you right about axis text. Also its grayed. And you have to play with formats to show what you want.

Anyway, it will hepl the users to see what they want.

I think it's a complex question whether it a bug or 'inimplementation' or feature.

Consider that in stacked mode QV shows Total value for a stack, while when you type the expression you do it for the entire dimension (don't know how to say it more clear).

Anyway, I hope it helps you.

Not applicable
Author

I changed the expression to utilize Dual and then changed to "Text on Axis". Still did not get the text, instead received individual counts for each dimension. This will not work. They want to see the total count and the percentage for a specific dimension relative to the count and not have to calculate it by hand. They want this text to be on/related to each bar.

Anonymous
Not applicable
Author

Okay, I did a demo test and ran into the same problem....so without directly addressing the issue for the stacked bar chart - I found a working way to achieve the same thing (with the stacked bar chart).

-Create the same expression your trying to use to get the stacked bar so in this case sum([Sample Count]) & 'XXXX'

-make the expression invisible

-select "Text on Axis"

This should allow your stacked bar to appear as it did before while adding your (multiple) data values pertaining to the bar along the axis.

Got to say that I'm not totally satisfied with the design if you have a long value to display but it works and has potential to be formatted to a more polished presentation. Either way, sorry for the confusion.....the point I was driving at was that while you try to figure out the more complex methods that generate the solution you need, you can serve up a working solution to the end-user with a "work-around", if you will, that achieves the same effect by using a simplier method. Learned this from an example where it was requested to display the customer's id next to the customer dimension, possibly in rollover pop-up or as another dimension. This was going to cause either a great burden on maintenance (popup) or exceed the working display area that I had to present the chart....so I just put the customer's id as a tag along to the dimension i.e. Customer&' - ('&CustomerId&')'

Anyway, hope that helps.

Anonymous
Not applicable
Author

See attachment

whiteline
Master II
Master II

2  bneumeier:

You're right. It adds something strange 'on axis' in stacked mode. Sometimes values from one level and somtimes from other.

I've managet to achive the same results as with "Text on Axis" but with 'Values on data points' (see the above post about adding invisible expression).

The problem is that you can't calculate it through every value of the 'stack'. Sometimes it takes one value from top and some times another from bottom. So unfortunately you can't calculate the ratio and the value of each part as you want.

I think this is another reason why QV overrides text representation of expression by default and displays only total amount for a stack bar.

Anonymous
Not applicable
Author

I think I'm missing something.....

When you create the invisible expression to appear as "Text on Axis", I am under the impression that you are calculating the provided expression expression against the dimension and displaying the resulting value along the axis.

Is this not the case?

whiteline
Master II
Master II

can we have the percentage relative to one of the ratings along with the total number

2 autopilot:

You calculate it against one (bar) dimension while the question is how to display the ratio of each stacked part (second dimension).

Your sample is oversimplified, create a stacked bar chart (2 dims), calculate the real sum value (don't substitute it to zero).

Then play with that chart, try to get  sum values in text (for each part of stack and entire for the stack).

Additional invisible expression works in both cases whether "Text on Axis" or 'Values on data points'. And works bad.