Changeset 885 for trunk/lib


Ignore:
Timestamp:
Nov 25, 2009, 12:03:58 AM (12 years ago)
Author:
Jari Häkkinen
Message:

Fixes #402. The legend is written in reverse order compared to the plot order, i.e., if total is plotted last it will be 1st in legend and over the other graphs.

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Graph.cc

    r884 r885  
    2424#include "Date.h"
    2525
     26#include <algorithm>
    2627#include <cmath>
    2728#include <sstream>
     
    124125    PLFLT dy=0.003*yrange_;
    125126    unsigned int row=0;
     127    std::reverse(legend_.begin(), legend_.end());
    126128    for (std::vector<legend_data>::const_iterator i=legend_.begin();
    127129         i!=legend_.end(); i++, ++row) {
  • trunk/lib/Graph.h

    r883 r885  
    5959
    6060    /**
    61        \brief Plot \a data using \a timeformat for x-axis values when
    62        dates are used.
     61       \brief Plot \a data and use \a lines and \a label to compose
     62       the legend label.
     63
     64       The legend will be a coloured line followed by \a lines
     65       followed by \a label.
     66
     67       The label order in the legend is reverse to the plot order,
     68       i.e., the last plotted line will get the top entry in the
     69       legend, the second to last plotted line will be the second
     70       legend entry, and so on.
    6371    */
    6472    void plot(const std::vector<unsigned int>& data, const std::string& label,
Note: See TracChangeset for help on using the changeset viewer.