Skip to content

Commit

Permalink
Merge pull request #1483 from peterbe/bug-912011-colors-in-front-page…
Browse files Browse the repository at this point in the history
…-graph-dont-match-headers-below

fixes bug 912011 - colors in front page graph don't match headers below
  • Loading branch information
brandonsavage committed Sep 10, 2013
2 parents e6c3805 + 3890db4 commit 2729643
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
Expand Up @@ -38,6 +38,8 @@ $(function() {
{ data: data["ratio" + 3], label: data.labels[2] },
{ data: data["ratio" + 4], label: data.labels[3] }
];
// this is a trick to make the legend appear as a list in one single row
chartOpts.legend.noColumns = chartData.length;
$.plot(aduChartContainer, chartData, chartOpts);
}
}
Expand Down
@@ -1,4 +1,4 @@
/*global $:true, socorro:true, crashReportsByBuildDateTmpl:true, crashReportsByVersionTmpl:true, Mustache:true */
/*global window:true, $:true, socorro:true, crashReportsByBuildDateTmpl:true, crashReportsByVersionTmpl:true, Mustache:true */
$(function() {
"use strict";
var chartContainer = $("#adu-chart"),
Expand Down Expand Up @@ -38,7 +38,10 @@ $(function() {
borderColor: '#c0c0c0',
borderWidth: 0
},
legend: {}
legend: {
position: 'ne',
noColumns: 4
}
};

var setSelected = function(item, container) {
Expand Down Expand Up @@ -136,11 +139,13 @@ $(function() {

if(data.count > 0) {
var chartData = [
{ data: data["ratio" + 1] },
{ data: data["ratio" + 2] },
{ data: data["ratio" + 3] },
{ data: data["ratio" + 4] }
{ data: data["ratio" + 1], label: data.labels[0] },
{ data: data["ratio" + 2], label: data.labels[1] },
{ data: data["ratio" + 3], label: data.labels[2] },
{ data: data["ratio" + 4], label: data.labels[3] }
];
// this is a trick to make the legend appear as a list in one single row
chartOpts.legend.noColumns = chartData.length;
$.plot(chartContainer, chartData, chartOpts);
} else {
chartContainer.empty().append("No Active Daily User crash data is available for this report.");
Expand Down
Expand Up @@ -272,7 +272,7 @@ <h2>Crashes per ADI</h2>
<tr>
<th class="date" rowspan="2">Date</th>
{% if form_selection == 'by_version' %}
{% for version in versions|reverse %}
{% for version in versions %}
<th class="version" colspan="4">{{ version }}</th>
{% endfor %}
{% else %}
Expand All @@ -283,7 +283,7 @@ <h2>Crashes per ADI</h2>
</tr>
<tr>
{% if form_selection == 'by_version' %}
{% for version in versions|reverse %}
{% for version in versions %}
<th class="stat">Crashes</th>
<th class="stat">ADI</th>
<th class="stat" title="The throttle rate is the effective throttle rate - the combined throttle rate for client-side throttling and server-side throttling.">Throttle</th>
Expand All @@ -298,12 +298,12 @@ <h2>Crashes per ADI</h2>
{% endfor %}
{% endif %}
</tr>
{% for crash_date in dates | reverse %}
{% for crash_date in dates %}
<tr>
<td>{{ crash_date }}</td>
{% if form_selection == 'by_version' %}
{% if crash_date in data_table.dates %}
{% for version in versions|reverse %}
{% for version in versions %}
{% set foundversion = [] %}
{% for crash_info in data_table.dates[crash_date] %}
{% if crash_info.version == version %}
Expand All @@ -323,7 +323,7 @@ <h2>Crashes per ADI</h2>
{% endif %}
{% endfor %}
{% else %}
{% for version in versions|reverse %}
{% for version in versions %}
<td>-</td>
<td>-</td>
<td title="The throttle rate is the effective throttle rate - the combined throttle rate for client-side throttling and server-side throttling.">-</td>
Expand Down
2 changes: 1 addition & 1 deletion webapp-django/crashstats/crashstats/views.py
Expand Up @@ -90,7 +90,7 @@ def build_data_object_for_adu_graphs(start_date, end_date, response_items,
}

for count, product_version in enumerate(sorted(response_items,
reverse=False),
reverse=True),
start=1):

graph_data['ratio%s' % count] = []
Expand Down

0 comments on commit 2729643

Please sign in to comment.