I have a Google Spreadsheet like this with a chart and a dropdown menu. I would like the data range of that chart to update based on a value selected from a dropdown menu.
I thought I might be able to add a Google App Script to the dropdown menu, but I can't find a way to add such script to anything but a drawing. Can someone tell me how to achieve this? Or point me into the right direction (Doc link?) as I'm new to both Google Spreadsheets and App Scripts.
Update: From the comments it seems using App Scripts onEdit trigger might work. The idea would be
- to trigger onEdit when the value from the dropdown cell changes
- fetch the cell value to use as an argument for another function
- that in turn alters the data range of a chart.
As far as I can see onEdit triggers with changes made to any cell. Is there a way to limit this trigger to specific cells/ranges?
datewas typo. I actually meantdatarange. The onEdit trigger looks like the way to go. - SomewhereDave