Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

always visible tooltip on google chart on page load?

Is there any way to make google charts tooltip always visible, no matter where the mouse pointer is? it should be constantly on after page load

like image 925
sukhi Avatar asked Mar 25 '14 13:03

sukhi


People also ask

How do I turn off tooltip in Google chart?

Use the enableInteractivity = False option. It will disable interaction and hover. Thanks Nix.

What is tooltip in Google Sheets chart?

Tooltips are the little boxes that pop up when you hover over something. (Hovercards are more general, and can appear anywhere on the screen; tooltips are always attached to something, like a dot on a scatter chart, or a bar on a bar chart.)

Is Google Charts deprecated?

While the dynamic and interactive Google Charts are actively maintained, we officially deprecated the static Google Image Charts way back in 2012. This gives us the right to turn it off without notice, which may happen soon.

How do I add a chart in tooltips?

Click the Insert menu in the Tooltip Editor. In the Insert menu, select Sheets, and then select a target sheet.


3 Answers

The best I could come up with is:

http://jsfiddle.net/xDfLd/

But if you interact with the chart (ie, click on different pie segments, or different line segments), the tooltip will disappear. Setting enableInteractivity:false I'll file a bug that tooltips and selections should still display when interactivity is off anyway.

like image 188
Jeremy Faller Avatar answered Oct 18 '22 02:10

Jeremy Faller


I combined what Jeremy posted with Yasen's comment and came to this solution:

var options = {
  enableInteractivity: false,
  selectionMode: 'multiple',
  tooltip: {
    trigger: 'selection'
  }
};

google.visualization.events.addListener(chart, 'ready', function(e) {
  var selected_rows = [];
  for (var i = 0; i < your_total_number_of_rows - 1; i++) {
    selected_rows.push({row: i, column: null});
  }
  chart.setSelection(selected_rows);
});

chart.draw(data, options);

This shows all the tooltips on load and prevents the user from messing around with them. Works great with the Pie Chart.

like image 22
tirdadc Avatar answered Oct 18 '22 00:10

tirdadc


Use tooltip: { trigger: 'selection' } when defining options for the chart.

like image 35
Vijay Web Avatar answered Oct 18 '22 02:10

Vijay Web