Changeset 947


Ignore:
Timestamp:
Dec 3, 2009, 11:33:03 PM (11 years ago)
Author:
Jari Häkkinen
Message:

Fixes 416

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Stats.cc

    r938 r947  
    387387
    388388    vec_type::iterator end(author_cont.end());
    389     for (vec_type::iterator i(author_cont.begin()); i!=end; ++i) {
     389    vec_type::iterator i(author_cont.begin());
     390    const vec_type::size_type maxauthors=8;
     391    int authskip=author_cont.size()-maxauthors;
     392    if (authskip>1) {
     393      // only use others if there is more than 1 author to be skipped,
     394      // there is no reason to add only 1 author to others.
     395      vec_type::iterator j(i);
     396      i+=authskip;
     397      std::vector<unsigned int> init(revision()+1);
     398      std::vector<unsigned int> others =
     399        std::accumulate(j, i, init, PairValuePlus<std::string,unsigned int>());
     400      unsigned char r, g, b;
     401      std::string label("others");
     402      Colors::instance().get_color(label, r,g,b);
     403      gp.current_color(r,g,b);
     404      gp.plot(others, label, others.back());
     405    }
     406    for ( ; i!=end; ++i) {
    390407      unsigned char r, g, b;
    391408      Colors::instance().get_color(i->first,r,g,b);
Note: See TracChangeset for help on using the changeset viewer.