Show comments as tooltips in a chart in Google Sheets


April 2019


5 time


I have an embedded line chart on Google Sheets.

I take data for the chart from the other tab of the same sheet.

I create comments in cells which I take data from.

It would be great to have comments be shown as popup tooltips when hovering over each data point.

The mechanism already has tooltips for each data point. It shows names of my horizontal axes now: "January", "February" etc.

Is there a way to show comments as tooltips and push my data to tooltips?

Here's my code:

//I can possibly use this more for tooltips
var options = {
    selectionMode: 'multiple',
    tooltip: {trigger: 'selection'},//or focus I guess
    aggregationTarget: 'series',
   //builds a chart
   var chart = sheet.newChart()
        .setPosition(2, 4, 0, 0)
        .setOption("title", name)
        .setOption('series.0.dataLabel', 'value') //shows data on the line
  //styling, but possibly can add some important data here?
        .setOption('tooltip', {0:{textStyle: {color: '#8A0829'}, showColorCode: true}}) 
        .setOption('aggregationTarget', options)


0 answers