COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Mfg on 04 May 2016 06:45:20 AM

Title: Custom Tooltips for Charts
Post by: Mfg on 04 May 2016 06:45:20 AM
Hi,

I want to remove '=' sign from tool tips of a bar/Pie/Line chart. is there any way to do that.
For Ex: 'Gross Sales= Gross Sales' but i want 'Gross Sales', which is on category along with 3 more items and i have multiple series items (calculated tuples) which are measure in this case. 

I have tried multiple methods but none of em are working as i mentioned below. At least can i remove '=' sign so that it can work out for me if i hide label or change data item source type to text and leave empty.

Tried following:
Quote
<script>
areas = document.getElementsByTagName('area');
var stop = 0;
var toMatch = new RegExp('Product line = " +  [Query1].[Product line] + "');
toMatch = toMatch.toString();
toMatch = toMatch.substring(1,toMatch.length -1);

for(i in areas) {
   if(areas.className='dl chart_area') {
      if(areas.title ){
         var title = areas.title;
         if( title.indexOf(toMatch) == 0 && title.indexOf('Revenue = ') > -1){
             areas.title = '" + [Query1].[Product line] + " - Quantity  - " + number2string([Query1].[Quantity]) + "';
            //alert( 'Changed ' + areas.title '  To  ' +  areas.title );
         }
      }
     }
}

</script>

Quotehttp://www.performanceg2.com/tricks-with-graphs-in-cognos-10/


Thanks in advance.

Title: Re: Custom Tooltips for Charts
Post by: MFGF on 05 May 2016 02:23:22 AM
Quote from: Mfg on 04 May 2016 06:45:20 AM
Hi,

I want to remove '=' sign from tool tips of a bar/Pie/Line chart. is there any way to do that.
For Ex: 'Gross Sales= Gross Sales' but i want 'Gross Sales', which is on category along with 3 more items and i have multiple series items (calculated tuples) which are measure in this case. 

I have tried multiple methods but none of em are working as i mentioned below. At least can i remove '=' sign so that it can work out for me if i hide label or change data item source type to text and leave empty.

Tried following:

Thanks in advance.

Hi,

As far as I'm aware the default tooltips are baked in by IBM. The only report controls you are given are to specify "Absolute, Cumulative or None", but there's nothing I'm aware of in the product simply to remove the = from the tooltip.

QuoteHey MF,

Can i remove '=' sign from chart tool tips....???

Thanks in advance

I don't do JavaScript, sadly, so I can't advise you on whether there's a JavaScript solution to this. I'd advise caution about using JavaScript moving forward, though - when you get to Cognos Analytics and want to use the new Interactive Viewer, you'll find all JavaScript gets ignored.

MF.
Title: Re: Custom Tooltips for Charts
Post by: Mfg on 05 May 2016 03:39:27 AM
 :'(
Title: Re: Custom Tooltips for Charts
Post by: schrotty on 08 May 2016 10:37:59 PM
Hi Mfg,

I found this a few days ago (they are using an extra Report Expression)
http://www.performanceg2.com/tricks-with-graphs-in-cognos-10/ (http://www.performanceg2.com/tricks-with-graphs-in-cognos-10/)

Schrotty

Title: Re: Custom Tooltips for Charts
Post by: Mfg on 09 May 2016 01:35:39 AM
Thanks for reply MF,

Hey I did go through that link but didn't get desired one, u didn't go through my post completely i think, cuz I've already mentioned that link. :)