Skip to content

Instantly share code, notes, and snippets.

@nfriedli
Last active August 29, 2015 14:17
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 nfriedli/0f63c5e64c6c7312499c to your computer and use it in GitHub Desktop.
Save nfriedli/0f63c5e64c6c7312499c to your computer and use it in GitHub Desktop.
Le template avec Google mais sans random
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Trans en retard'],
['OK', {{ circule }}],
['Retard', {{ retard }}]
]);
var options = {
title: '{{ depart }} > {{ arrive }}'
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
</head>
<body>
<h1>{{ depart }} > {{ arrive }}</h1>
<p>Le trajet de {{ depart }} vers {{ arrive }} sur l'axe {{ axe }} prevoit {{ nombre }} trains.</p>
<p>{{ circule }} trains sont partis. {{ retard }} etaient en retard.</p>
<div id="piechart" style="width: 900px; height: 500px;"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment