I needed help for Google Chart.

115 views
Skip to first unread message

Vivek Singh

unread,
Mar 20, 2024, 8:54:50 AMMar 20
to Google Visualization API
I am using Google line chart for developing the graph. I need to show custom tooltip in which i need to render html code. But the custom tooltip only work on single line in graph, but hovering on another lines it show default tool tip provided by google chart. I wanted to show html custom tool tip on both lines.

Here is my code:

var data = new google.visualization.DataTable();
data.addColumn('number', 'Y');
data.addColumn('number', 'D0 Response');
data.addColumn('number', 'D1 Response');
data.addColumn('number', '');
data.addColumn({type: 'string', role: 'tooltip', p: {'html': true}});

I also try this:
  tooltip: {
        isHtml: true,
       },

Nothing works.

Daniel LaLiberte

unread,
Mar 20, 2024, 10:18:05 AMMar 20
to google-visua...@googlegroups.com
You'll need to add your custom tooltip column after each column that corresponds to a series that you want the custom tooltip to apply to.  

Alternatively, I believe you can aggregate all your tooltips into one 'category' tooltip.  Use the focusTarget: 'category' option.   See the "London Olympics Medals" example on https://developers.google.com/chart/interactive/docs/customizing_tooltip_content


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/4f1546ed-4cbe-46f4-a324-0095a7c81734n%40googlegroups.com.


--

Daniel LaLiberte

 • SWE

 Cambridge MA

 • dlaliberte@Google.com

Reply all
Reply to author
Forward
0 new messages