Skip to content

Instantly share code, notes, and snippets.

@cliffordp
Forked from steveandroulakis/sync-files-chart
Last active February 2, 2020 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cliffordp/15bac1520be136e3da0f66b74554e78e to your computer and use it in GitHub Desktop.
Save cliffordp/15bac1520be136e3da0f66b74554e78e to your computer and use it in GitHub Desktop.
google charts sync data
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://vera183.its.monash.edu.au/static/js/lib/jquery-1.7.1.min.ddb84c158728.js"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var jsonData = $.ajax({
url: "http://bdp-aaf-dev.dyndns.org/sampledata.json",
dataType:"json",
async: false
}).responseText;
// Create our data table out of JSON data loaded from server.
var data = new google.visualization.DataTable(jsonData, 0.6);
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
var options = {
width: 1080,
height: 810,
title: 'store.synchrotron - Files stored in MyTardis',
colors: ['#e0440e', '#e6693e', '#ec8f6e', '#f3b49f', '#f6c7b6'],
hAxis: { textStyle: { fontSize: '12'}, showTextEvery: '8' },
pointSize: 3
};
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="chart_div"></div>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment