'Dygraphs HTML: Can I always display the LATEST data point (time series line chart)

I am making a widget for my dashboard. It is a US 10 year treasury market yield. I have completed most of flow. (FRED raw data -> Google Sheet (App Script) -> HTML/Dygraphs

However, in the Dygraphs HTML script, I want to always display the latest data point (which will be updated every 6 hours by using App Script). Hopefully the data will be displayed on the right hand edge of the chart.

Here is my current code.

<html lang="en">
<head>
<script src="//cdnjs.cloudflare.com/ajax/libs/dygraph/2.1.0/dygraph.min.js"></script>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/dygraph/2.1.0/dygraph.min.css" />
</head>
  
<body style="margin: 0px; overflow: hidden; width: 100%; height: 100%;">

<div id="US10Y" style="height:100%; margin-right:20px;"></div>

<script type="text/javascript">
  
  stockchart = new Dygraph(
    document.getElementById("US10Y"),
    "https://docs.google.com/spreadsheets/d/e/2PACX-1vSS-AHAVA-D9TVKRuJOoUSiefG6qoOI-5ts-nfrO3Su75A32xJZFNhqsPCM-GRqNnoxQO8Y9xbG5L9r/pub?gid=0&single=true&output=csv"
  )
</script>

  
  
  </body>
</html>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source