I am new to javascript. I am trying to get scrolling working for a Google Linechart but all I get is a static graph and no scrolling. I am using the example I found at the below link which works well for the set of defined data in the example but when I try and load data from a CSV file then just the static graph.
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="jquery.csv.js"></script>
<script type="text/javascript">
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(BasicLine);
function BasicLine()
{
$.get("mil.csv", function(csvString)
{
var arrayData = $.csv.toArrays(csvString, {onParseValue: $.csv.hooks.castToScalar}),
data = new google.visualization.arrayToDataTable(arrayData),
options = {
hAxis:
{
title: 'Date'
},
vAxis:
{
title: 'Total'
},
backgroundColor: '#f1f8e9',
lineWidth: 0.7,
chartArea:{width:'100%',height:'100%'},
vAxis: {
minValue: 0
},
explorer: {
axis: 'horizontal',
keepInBounds: true,
maxZoomIn: 4.0
},
},
chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}, 'text');
}
</script>
</head>
<body>
<!--Div that will hold the pie chart-->
<div id="chart_div"></div>
</body>
</html>
CSV File (first 20 rows)
Date,Total
9-Oct-17,103173
10-Oct-17,103377
11-Oct-17,103903
12-Oct-17,103644
13-Oct-17,103511
14-Oct-17,103511
15-Oct-17,103511
16-Oct-17,103541
17-Oct-17,103636
18-Oct-17,103868
19-Oct-17,104419
20-Oct-17,104770
21-Oct-17,104770
22-Oct-17,104770
23-Oct-17,104748
24-Oct-17,104986
25-Oct-17,104994
26-Oct-17,105246
27-Oct-17,105424