Here's the code I use. Not sure if this is what you're looking for:
<script type="text/javascript">
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart () {
$.ajax({
url: 'output.txt',
type: 'get',
success: function (txt) {
var dataArray = [['Date', 'Price']];
var txtArray = txt.split('\n');
for (var i = 0; i < txtArray.length; i++) {
var tmpData = txtArray[i].split(/,/);
dataArray.push([tmpData[0], parseInt(tmpData[1])]);
}
var data = google.visualization.arrayToDataTable(dataArray);
var chart = new google.visualization.LineChart(document.querySelector('#chart_div'));
var options = {
title: 'Value of this Car',
width: 430,
height: 252,
vAxis: { format:'$####'}
};
chart.draw(data,options);
}
});
}
google.load('visualization', '1', {packages:['corechart'], callback: drawChart});
</script>
The text file I use (output.txt):
Jan 2016,940
Apr 2016,940
Jul 2016,950
Oct 2016,950
Jan 2017,975
Apr 2017,977
Jul 2017,1045
Oct 2017,1115
Jan 2018,1115
Apr 2018,1123
Hope this helps.
Scott