source: trunk/lib/GnuplotFE.cc @ 73

Last change on this file since 73 was 73, checked in by Jari Häkkinen, 16 years ago

Divided Gnuplot class into a basic gnuplot communication class
and a front end class specialized for svnstat.
Added option to plot stats against time or revision.
Removed gnuplot usage of temporary files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 790 bytes
Line 
1// $Id: GnuplotFE.cc 73 2006-03-04 18:10:07Z jari $
2
3#include "GnuplotFE.h"
4#include "Gnuplot.h"
5
6#include <string>
7
8
9namespace theplu {
10namespace svnstat {
11
12
13  GnuplotFE* GnuplotFE::instance_=NULL;
14
15
16  void GnuplotFE::plot(const std::vector<double>& y, const std::string& format)
17  {
18    if (!date_.empty()) {
19      command(std::string("set xdata time"));
20      command("set timefmt '" + date_input_format_ + "'");
21      command("set format x '" + format + "'");
22      Gnuplot::plot(y,date_);
23      command(std::string("set xdata"));
24    }
25    else
26      Gnuplot::plot(y);
27  }
28
29
30  void GnuplotFE::replot(const std::vector<double>& y)
31  {
32    if (!date_.empty()) {
33      command(std::string("set xdata time"));
34      Gnuplot::replot(y,date_);
35      command(std::string("set xdata"));
36    }
37    else
38      Gnuplot::replot(y);
39  }
40
41
42}} // end of namespace svnstat and namespace theplu
Note: See TracBrowser for help on using the repository browser.