Can't hide tooltip (equation) on trendline in google chart

can you help me hide the tooltip (equation) on the trendline in google chart on this page ?

thank

Here are the chart options I am using:

var options = {
        title: 'Weight of pro surfer vs. Volume of his pro model',
        hAxis: {title: 'Weight (kg)', minValue: 53, maxValue: 100}, //55
        vAxis: {title: 'Volume (l)'}, //, minValue: 20, maxValue: 40},   //20
        legend: 'none',
           colors: ['#000000'],
           series: {
                  1: { color: '#06b4c8' }, 
                  2: { color: '#575e6a' }
              },
        legend: {position: 'top right', textStyle: {fontSize: 8}},
        chartArea: {width: '60%'},
        //tooltip:{trigger:'none'}, //it hides all tooltips on the whole graph
        trendlines: { 0: {//type: 'exponential',
                    visibleInLegend: true,
                    color: 'grey',
                    lineWidth: 2,
                    opacity: 0.2,
                    tooltip:{trigger:'none'}, //does nothing
                    labelInLegend: 'Linear trendline\n(Performance)'
                    } 
                }    // Draw a trendline for data series 0.
    };

      

If I add tooltip:{trigger:'none'},

before trendlines

, it hides the tooltips of the whole plot.

+3


source to share


2 answers


The only solution I was able to make was to replace the tooltip text from the trendline. This example uses jquery, so if you can use jquery you can use:

      google.visualization.events.addListener(chart, 'onmouseover', function(e){
          $('svg *:contains("* x")').each(function(){
              $(this).text('')
          })
      })

      



If it isn't, you should be able to replicate pure js, but this is the basic idea: find tooltips that have a formula attached and replace the text with nothing

Here's a working example: http://jsfiddle.net/juvian/aapdjbpt/

+4


source


It has been implemented but not yet documented:



trendlines: {0: {tooltip: false}}

      

+12


source







All Articles