blob: 1e38fb77b97e2cd022cf4048cb452a1277aad91a [file] [log] [blame]
{% 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_chart.test_name }}'));
var json_data = new google.visualization.DataTable(
{% autoescape off %}{{ tpl_chart.gviz_data_table }}{% endautoescape %}, 0.5);
{% block add_listener %}{% endblock %}
chart.draw(
json_data,
{chartArea: {top:6},
hAxis: {
slantedText: true,
slantedTextAngle: 90,
textStyle: {fontSize: 10}},
height: {{ tpl_params.height|default:600 }},
interpolateNulls: true,
is3D: true,
pointSize: 3,
{% ifequal tpl_chart.test_keys|length 1 %}
colors: ['{{ tpl_colors|random }}'],
legend: 'none',
{% else %}
legendTextStyle: {fontSize: 10},
{% endifequal %}
width: {{ tpl_params.width|default:800 }}});
}
</script>
<center>
<h4>
<a href = "{{ tpl_path }}" target="_blank">
{% ifequal tpl_chart.test_keys|length 1 %}
{{ tpl_chart.test_name }} - {{ tpl_chart.test_keys.0 }}
{% else %}
{{ tpl_chart.chart_title }}
{% endifequal %}
</a>
</h4>
{% block subtitle_block %}{% endblock %}
<span id="{{ tpl_chart.test_name }}"></span>
</center>
{% block add_iframe %}{% endblock %}
{% endblock %}