Changeset 1441


Ignore:
Timestamp:
10/31/15 15:32:24 (9 years ago)
Author:
nanardon
Message:

Sort value according last stat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Json/Stat.pm

    r1438 r1441  
    4242 
    4343    my $data = $ostat->getAllStat or return; 
     44    my $res = $ostat->getStat or return; 
    4445 
    4546    my $graph = { 
     
    5253    foreach my $date (sort keys %$data) { 
    5354        foreach my $val (sort keys %{ $data->{$date} }) { 
     55            $res->{ $val } ||= 0; 
    5456            push(@{ $lines{$val} }, [ $date, $data->{$date}{$val} + 0 ]); 
    5557        } 
    5658    } 
    5759 
    58     foreach (sort keys %lines) { 
     60    foreach (sort { $res->{$b} <=> $res->{$a} } keys %lines) { 
    5961        push(@{ $graph->{data} }, $lines{$_}); 
    6062        push(@{ $graph->{series} }, { label => $_ }); 
Note: See TracChangeset for help on using the changeset viewer.