Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Unified Diff: frontend/croschart/templates/plot_chart.html

Issue 6821082: Integrate dynamic charts into autotest frontend. (Closed) Base URL: ssh://gitrw.chromium.org:9222/autotest.git@master
Patch Set: Add license. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frontend/croschart/templates/charts.html ('k') | frontend/croschart/templates/plot_unavailable.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frontend/croschart/templates/plot_chart.html
diff --git a/frontend/croschart/templates/plot_chart.html b/frontend/croschart/templates/plot_chart.html
new file mode 100644
index 0000000000000000000000000000000000000000..6f0fe7dee0db03b63564e3df1d281637c6309b10
--- /dev/null
+++ b/frontend/croschart/templates/plot_chart.html
@@ -0,0 +1,58 @@
+{% extends "base.html" %}
+{% comment %}
+
+Copyright 2010 Google Inc. All Rights Reserved.
+
+This template builds a single plot on a single page for a zoomed-in view.
+{% endcomment %}
+{% block title %}ChromeOS Performance Chart{% endblock %}
+{% block html_block %}
+<!--Load the AJAX API-->
+<script type="text/javascript" src="https://www.google.com/jsapi"></script>
+<script type="text/javascript">
+ // Load the Visualization API and the piechart package.
+ google.load('visualization', '1', {'packages':['corechart']});
+
+ // Set a callback to run when the Google Visualization API is loaded.
+ google.setOnLoadCallback(drawCharts);
+
+ // Callback that creates and populates a data table,
+ // instantiates the charts, passes in the data and
+ // draws them.
+ function drawCharts() {
+ var chart = new google.visualization.LineChart(
+ document.getElementById('{{ tpl_gviz_id }}'));
+ var json_data = new google.visualization.DataTable(
+ {% autoescape off %}{{ tpl_gviz_js }}{% endautoescape %}, 0.5);
+ google.visualization.events.addListener(chart, 'select', function(){
+ var build_tags = [
+ {% for job_tag in tpl_job_tags %}
+ '{{ job_tag }}'{% if not forloop.last %},{% endif %}
+ {% endfor %}
+ ];
+ window.open(
+ 'http://cautotest/results/' +
+ build_tags[chart.getSelection()[0].row] +
+ '/' + '{{ tpl_gviz_title }}' +
+ '/results/keyval')
+ });
+ chart.draw(
+ json_data,
+ {colors: ['{{ tpl_colors|random }}'],
+ hAxis: {
+ slantedText: true,
+ slantedTextAngle: 90,
+ textStyle: {fontSize: 10}},
+ height: {{ tpl_height }},
+ is3D: true,
+ pointSize: 3,
+ legend: 'none',
+ title: '{{ tpl_gviz_title }} - {{ tpl_perf_key }}',
+ titlePosition: 'out',
+ width: {{ tpl_width }}});
+ }
+</script>
+<center>
+<span id="{{ tpl_gviz_id }}"></span>
+</center>
+{% endblock %}
« no previous file with comments | « frontend/croschart/templates/charts.html ('k') | frontend/croschart/templates/plot_unavailable.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698