Google Graphical Chart - Disable tooltip for single column

I know this question has already been asked before. Using the Google Visualization API, how do I disable tooltips for a single column? but I didn’t get a familiar answer. Please someone tell me how to disable tooltip for single column? I tried this

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

but it disables the tooltip for all columns. I need only one column with the tooltip disabled, and all other columns should have the tooltip enabled.

+4
source share
3 answers

The parameter is enableInteractivity: falselocked as an option to select a series, etc.

You can do it the best way:

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

.

+8

, , , , enableInteractivity: false .

, , ...

+2

Google. , , .

"" , , . :

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 rows in the chart), and I was able to "disable" tooltips on 2 of them using this technique.

+2
source

Source: https://habr.com/ru/post/1533285/


All Articles