Last active
January 31, 2020 03:39
-
-
Save steveandroulakis/5872800 to your computer and use it in GitHub Desktop.
google charts sync data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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