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 notes in cells which I take data from.
It would be great to have notes 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 notes 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()
.setChartType(Charts.ChartType.LINE)
.addRange(range).setTransposeRowsAndColumns(true)
.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)
.build();
sheet.insertChart(chart);