Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.