I need to add in another row of text on each of the tooltips I'm displaying (on an area chart). I've included a screenshot to illustrate what I'm hoping to do.
My current chart: The chart with the additional text added. (This is what I'm trying to do):
I'm hoping to do this without having to use a third party JS for custom tooltips. Is there any way to just add another row of text-based content to be displayed in the default tooltips?
Any help is greatly appreciated.
Have a look at https://developers.google.com/chart/interactive/docs/roles#whatrolesavailable:
Additional tooltip rows are what you are looking for!
The example:
If you enable
focusTarget: 'category'
in the options. Then thetooltip
column becomes avalue
for the the tooltip of the currentx
,y
dots (which gets rendered the way you want). So you can mimic thevalue
and add the additional text you want. Here is an example what I mean:-I haven't found a way to add another data row to the default tooltips. You can get close to what you are looking for using HTML tooltips. You do lose the tail on the tooltip though. Here is a JSbin with the solution I used... http://jsbin.com/tovizukabu/3/edit?css,js,output
And the CSS...