Getting to do this way, using role annotation, and expecting the guy line, from which we can put a line at a certain point of the graph, in its case, the last point.for this we need to add a new column, the type mentioned above, to all your records:data.addColumn({type: 'string', role: 'annotation'});
And at each point specify the value, where we want or do not have the annotation:[0, 0,null]
Then change the options of annotation, where from what I realized, you do not want a text, just want to appear the line, then we will "take" with the text, and leave the color of the line in black, because the pattern is a clear ash:annotations: {
style: 'line',
textStyle: {
fontSize: 100,
opacity: 0
},
datum: { stem: {color: "black"}}
}
I left it. fontSize in 100 to have a larger line.Result:google.charts.load('current', {packages: ['corechart', 'line']});
google.charts.setOnLoadCallback(drawBasic);
function drawBasic() {
var data = new google.visualization.DataTable();
data.addColumn('number', 'X');
data.addColumn('number', 'Dogs');
data.addColumn({type: 'string', role: 'annotation'});
data.addRows([
[0, 0,null], [1, 10,null], [2, 23,null], [3, 17,null], [4, 18,null], [5, 9,null],
[6, 11,null], [7, 27,null], [8, 33,null], [9, 40,null], [10, 32,null], [11, 35,null],
[12, 30,null], [13, 40,null], [14, 42,null], [15, 47,null], [16, 44,null], [17, 48,null],
[18, 52,null], [19, 54,null], [20, 42,null], [21, 55,null], [22, 56,null], [23, 57,null],
[24, 60,null], [25, 50,null], [26, 52,null], [27, 51,null], [28, 49,null], [29, 53,null],
[30, 55,null], [31, 60,null], [32, 61,null], [33, 59,null], [34, 62,null], [35, 65,null],
[36, 62,null], [37, 58,null], [38, 55,null], [39, 61,null], [40, 64,null], [41, 65,null],
[42, 63,null], [43, 66,null], [44, 67,null], [45, 69,null], [46, 69,null], [47, 70,null],
[48, 72,null], [49, 68,null], [50, 66,null], [51, 65,null], [52, 67,null], [53, 70,null],
[54, 71,null], [55, 72,null], [56, 73,null], [57, 75,null], [58, 70,null], [59, 68,null],
[60, 64,null], [61, 60,null], [62, 65,null], [63, 67,null], [64, 68,null], [65, 69,null],
[66, 70,null], [67, 72,null], [68, 75,null], [69, 80,null],[69, 80," "]
]);
var options = {
hAxis: {
title: 'Time'
},
vAxis: {
title: 'Popularity'
},
annotations: {
style: 'line',
alwaysOutside: 'true',
textStyle: {
fontSize: 100,
color: "black",
opacity: 0
},
datum: { stem: {color: "black"}}
}
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}</code></pre><pre class="snippet-code-html lang-html prettyprint-override"><code> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>Documentation: https://developers.google.com/chart/interactive/docs/roles https://developers.google.com/chart/interactive/docs/gallery/columnchart