I'm trying to figure out how to add annotations to my ColumnChart when my data comes from a URL to a Google Sheet. I have found many examples online with a data table created right in the code. I have added a column into my data that's supposed to serve the "annotation" role, but I can't figure out how to specify its role and use that in my code. This is what I have:
google.charts.load('current');
function drawFireClassChart(year = slider.value) {
var wrapper_class = new google.visualization.ChartWrapper({
chartType: 'ColumnChart',
dataSourceUrl: 'https://docs.google.com/spreadsheets/d/1D_JZN9YRYWiPvxErx9AtLSTtncZ3KAcBisXDtyzPr6E/edit#gid=1683808434?key=[hidden]',
query: 'SELECT B,C,D WHERE A = "'+String(year)+'"',
options: {'colors': ['#fab85d'],
'hAxis' : { 'title' : 'Class' },
'title': 'Distribution of Fire Sizes, Classed A-G',
'titleTextStyle': {'fontSize': '14'},
'legend' : {position: 'none' },
'vAxis' : {format: 'decimal',
title: 'Number of Fires',
maxValue: 58000},
'displayAnnotations' : true,
'annotations': {'alwaysOutside' : true}},
containerId: 'fire_class_div'
});
In my query, column D is what holds the annotation values. I would appreciate any help!