[Rt-commit] r5771 - in rt/branches/3.6-RELEASE: .
html/Search/Elements
jesse at bestpractical.com
jesse at bestpractical.com
Tue Aug 15 00:01:55 EDT 2006
Author: jesse
Date: Tue Aug 15 00:01:54 2006
New Revision: 5771
Modified:
rt/branches/3.6-RELEASE/ (props changed)
rt/branches/3.6-RELEASE/html/Search/Chart
rt/branches/3.6-RELEASE/html/Search/Elements/Chart
Log:
r20425 at pinglin: jesse | 2006-08-15 00:01:34 -0400
* We now sort chart results before displaying them. Reported by Petter Reinholdtsen
Modified: rt/branches/3.6-RELEASE/html/Search/Chart
==============================================================================
--- rt/branches/3.6-RELEASE/html/Search/Chart (original)
+++ rt/branches/3.6-RELEASE/html/Search/Chart Tue Aug 15 00:01:54 2006
@@ -77,7 +77,14 @@
@values = (0);
}
-my $plot = $chart->plot( [ [@keys], [@values] ] ) or die $chart->error;
+my %data;
+foreach my $key (@keys) { $data{$key} = shift @values; }
+my @sorted_keys = sort @keys;
+my @sorted_values = map { $data{$_}} @sorted_keys;
+
+
+
+my $plot = $chart->plot( [ [@sorted_keys], [@sorted_values] ] ) or die $chart->error;
if ( $plot->can('png') ) {
$r->content_type('image/png');
Modified: rt/branches/3.6-RELEASE/html/Search/Elements/Chart
==============================================================================
--- rt/branches/3.6-RELEASE/html/Search/Elements/Chart (original)
+++ rt/branches/3.6-RELEASE/html/Search/Elements/Chart Tue Aug 15 00:01:54 2006
@@ -89,6 +89,11 @@
}
}
+my %data;
+foreach my $key (@keys) { $data{$key} = shift @values; }
+my @sorted_keys = sort @keys;
+my @sorted_values = map { $data{$_}} @sorted_keys;
+
my $query_string = $m->comp('/Elements/QueryString', %ARGS);
</%init>
@@ -105,9 +110,9 @@
</th>
</tr>
% my ($i,$total);
-% while (my $key = shift @keys) {
+% while (my $key = shift @sorted_keys) {
% $i++;
-% my $value = shift @values;
+% my $value = shift @sorted_values;
% $total += $value;
<tr class="<%$i%2 ? 'evenline' : 'oddline' %>">
<td class="label collection-as-table">
More information about the Rt-commit
mailing list