56fdefeccd
Initial import after cleanup. Previous history lives in https://code.launchpad.net/~ttx/+junk/odsreg
41 lines
1.5 KiB
HTML
41 lines
1.5 KiB
HTML
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
|
|
<script type="text/javascript">
|
|
google.load('visualization', '1', {packages: ['corechart']});
|
|
function drawVisualization() {
|
|
// Create and populate the data table.
|
|
var data = new google.visualization.DataTable();
|
|
data.addColumn('string', 'Type');
|
|
data.addColumn('number', 'Available')
|
|
data.addColumn('number', 'Preapproved')
|
|
data.addColumn('number', 'Unreviewed')
|
|
data.addColumn('number', 'Incomplete')
|
|
data.addColumn('number', 'Scheduled')
|
|
data.addRows(2);
|
|
data.setValue(0,0,'Proposed')
|
|
data.setValue(1,0,'Available')
|
|
|
|
data.setValue(0,2, {{ stats.A }}); //Accepted
|
|
data.setValue(0,3, {{ stats.U }}); //Unreviewed
|
|
data.setValue(0,4, {{ stats.I }}); //Incomplete
|
|
data.setValue(0,5, {{ stats.S }}); //Scheduled
|
|
data.setValue(1,1, {{ stats.avail }}); //Available */
|
|
|
|
|
|
// Create and draw the visualization.
|
|
new google.visualization.BarChart(document.getElementById('visualization')).
|
|
draw(data,
|
|
{ chartArea: {height:36,width:400}, width:540, height:70,
|
|
series: {0:{visibleInLegend: false},
|
|
1:{color: '#109618'},
|
|
2:{color: '#aaaaaa'},
|
|
3:{color: '#ff9900'}},
|
|
hAxis: {textPosition: 'none', maxValue: {{stats.max}},
|
|
gridlines: {count: {{stats.max}} +1 }},
|
|
enableInteractivity: false,
|
|
isStacked: true, legend: 'bottom'}
|
|
);
|
|
}
|
|
google.setOnLoadCallback(drawVisualization);
|
|
</script>
|
|
<div id="visualization"></div>
|