If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Is it possible to change chart tooltip

Started by aydakut, 10 Feb 2012 02:38:46 AM

Previous topic - Next topic

aydakut

Hi, We would like to know if we can change the tooltip of a chart dynamically by using parameters.
Thanks.

kattaviz

Hi,
I have used the following script to chage the default tool tips for charts.

<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>

HTH
thanks & regards
Satish Katta