Skip to content

Instantly share code, notes, and snippets.

@critmcdonald
Last active December 21, 2015 05:39
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 critmcdonald/6258467 to your computer and use it in GitHub Desktop.
Save critmcdonald/6258467 to your computer and use it in GitHub Desktop.

Just a test, really.

<script type='text/javascript' src='https://www.google.com/jsapi'></script>
<script type="text/javascript">
var CI1;
var CI1Value = "[@field:CI1]";
if (CI1Value !== "") {
CI1 = Number(CI1Value);
} else {
CI1 = "";
}
var CI1CutValue = "[@field:CI1_CUT]";
if (CI1CutValue !== "") {
CI1Cut = Number(CI1CutValue);
} else {
CI1Cut = "";
}
</script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["gauge"]});
google.setOnLoadCallback(drawChart01);
function drawChart01() {
var data = google.visualization.arrayToDataTable([
["Label", "Value"],
["Index 1", CI1],
]);
var options = {
width: 400, height: 120,
redFrom: 0, redTo: CI1Cut,
yellowFrom: CI1Cut, yellowTo: 100,
minorTicks: 5,
yellowColor: "#009900"
};
var chart = new google.visualization.Gauge(document.getElementById("chart_div_01"));
chart.draw(data, options);
}
</script>
<script type="text/javascript">
if (CI1 !== "" && CI1Cut !== "") {
document.write("<div class=\"gauge_display\">");
document.write("<div id='chart_div_01'><\/div>");
document.write("<h4>Student Achievement<\/h4>");
document.write("<p>(Target: " + CI1Cut + ")<\/p>");
document.write("<\/div>");
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment