4

I know this question was already asked before Using Google Visualization API, how to turn off tooltips for a single column?, but i didn't get familiar answer.Please can somebody tell me how to turn off tooltip for a single column?.I tried this

chart.draw(data, {trigger:'none'});

but it turns off tooltip for all the columns.I want only one column with tooltip disabled and all other columns should have enabled tooltip.

Community
  • 1
  • 1
user3445687
  • 41
  • 1
  • 4

3 Answers3

12

The option enableInteractivity: false blocked alse the series select option and etc.

You can do it with better way:

Option = {
  series : {      
          0: { tooltip : false}, // disable tooltip
          1: { tooltip : true}, // enable tooltip
          2: { tooltip : false},
          3: { tooltip : true},
          4: { tooltip : true},
      }
}

It works for me perfectly.

Shogg
  • 796
  • 2
  • 7
  • 14
Stack Overflow
  • 2,416
  • 6
  • 23
  • 45
2

I don't believe that it is possible, but you can disable interactivity which will prevent tool-tips showing by adding enableInteractivity: false to the series.

I hope this helps in your situation, it worked for mine...

MatthewH
  • 21
  • 4
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment). – Strawberry May 08 '14 at 13:45
  • Yeah thanks, not helpful at all. I really don't know why I bother when I get comments back like this. I'm trying to help this guy who has been ignored on the same question in 2 posts over 6+ months. I don't have the reputation to comment, and probably never will, but I did want to try to help! BTW, "I don't believe it is possible" is an answer, and probably the correct one from everything I researched. If anyone knows better they can answer and get credit for being correct. – MatthewH May 09 '14 at 21:50
2

I too was just now looking for a way to disable tooltips for a single column inside my google line chart. The above answer isn't far off but I guess it isn't completely clear.

There is no way to "disable" tooltips for a single column, however you can disable interactivity for a single column which as far as I can tell results in the same wanted behavior. To do so, simply use the series inside the chart options as such:

series :{
0:{
enableInteractivity: false,
tooltip: 'none'}
}

Or a longer example:

var options = {
        tooltip: {isHtml: true},
        legend: 'none',
        chartArea: {
            width: 500,
        },
        lineWidth: 2,
        series: {
            0: { }, // Output
            1: { enableInteractivity: false, tooltip: 'none', lineDashStyle: [2, 2] },
            2: { enableInteractivity: false, tooltip: 'none' },
        },
        colors: ['#6f9654', '#1c91c0', '#7F3F98'],
    };

    var chart = new google.visualization.LineChart(document.getElementById('myChart'));

    chart.draw(dataTable, options);

I found the answer here: https://groups.google.com/forum/#!topic/google-visualization-api/ZADPolRZtxM

And this works for me.. I have a line chart with 3 columns (3 lines in the chart) and I was able to "disable" tooltips on 2 of them using this technique.

vesperknight
  • 720
  • 9
  • 17