1

I have a Cognos chart and I want to be able to turn on one label that shows the amount for just the bar that is showing with conditional formatting (the selected center from a drop down list).

I have found a way to turn all of the labels on, and all of the labels off with Cognos chart - show values - but there has to be a way to only turn on just one specified value.

I am trying to create some JavaScript that will assist me in manipulating the specific element that is the selected value for my chart. Does anyone know how to find the ElementID for each individual bar in a Cognos bar chart?

Here is an example rendering of what Cognos creates will all the labels turned on: https://i.stack.imgur.com/Hq89s.jpg

I am trying to create a rendering with only the label for the blue bar showing.

  • So I found out that the data labels are controlled by XML, not by Javascript. Here is the code that turns the labels on within the XML: -- now how to render this code and only turn on the one lable, I still am uncertain, but I thought I'd share... possibly this can help stir up some new ideas...? – charlotte2483 Jul 26 '13 at 14:59
  • Is this a realational report or is it from a cube? You should be able to dynamically generate the labels by changing the label source type from 'Member Caption' to 'Report Expression'. Then you can build an expression which makes the labels balnk when you require. If this works you will not need to use javascript. – Nick.Mc Jul 30 '13 at 06:43
  • at least reference your duplicate question http://stackoverflow.com/questions/17730587/cognos-popout-label-for-selected-item. Otherwise people waste time suggesting things that have already been discussed. – Nick.Mc Jul 30 '13 at 06:47
  • Reading your other question: are you trying to hide labels or make bars blue? The standard workaround for making a bar blue is to actually use a stacked chart and ensure for Florida, the grey part is zero, and for all the other regions, the blue part is zero. i've had sucess hacking charts before by basically putting a div and find/replace the HTML at runtime. But it is definitely a hack. – Nick.Mc Jul 30 '13 at 06:50
  • Hi, thank you for your comment. No, I was not trying to make the bars blue, they are already blue. I am simply trying to make a label display for just the blue item. – charlotte2483 Aug 02 '13 at 12:32
  • So is this from a cube or is it relational? Can you create a data item in your query that returns a blank string or the correct label depending on your requirements? You can then use `Report Expression` rather than `Member Caption` for the `Source Type` for your categories. – Nick.Mc Aug 05 '13 at 01:08
  • Cube - however, report expression is not available for the chart labels section. – charlotte2483 Aug 05 '13 at 11:29
  • Going from Report Studio, version 8.4, click on the data item that you dragged under `Categories (x-axis)` to provide your categories. In the properties area against `Source Type`, change from `Member Caption` to `Report Expression`. See if you can control the label from that. – Nick.Mc Aug 07 '13 at 05:32
  • Selecting the x axis and modifying the report expression - allows you to modify the labels for the x-axis, however, this is not what I am trying to do. Basically, by modifying the x-axis labels - I can change the names of the States that appear across the bottom, but I am trying to only show the value (above the bar on my bar chart) for a specific state. Thank you for helping me brainstorm though -- every little bit helps! :) – charlotte2483 Aug 14 '13 at 13:53
  • Oh sorry, I totally missed that. – Nick.Mc Aug 16 '13 at 04:03

1 Answers1

0

just click on 'series' on chart

set from properties pane

value to 'yes'

Grouping type ---> stacked

value location ----> outside top

value type ----> absolute

Schleis
  • 41,516
  • 7
  • 68
  • 87
zohaib
  • 1