Changeset 864 for trunk/lib/File.cc


Ignore:
Timestamp:
Nov 20, 2009, 9:12:30 PM (12 years ago)
Author:
Jari Häkkinen
Message:

Addresses #97. All plots generated. Now its time to go for publication quality plots.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/File.cc

    r858 r864  
    4141#include <stdexcept>
    4242#include <string>
     43#include <sstream>
    4344#include <sys/stat.h>
    4445
     
    363364    std::string outpath = stats_type+"/"+user+"/"+line_type+"/"+lpath;
    364365    std::string imagefile = stats_type+"/"+"images/"+line_type+"/"+
    365       lpath+".png";
     366      lpath+".svg";
    366367    std::string html_name(outpath + ".html");
    367368    std::ofstream os(html_name.c_str());
     
    369370                 stats_type);
    370371    path_anchor(os);
    371     os << "<p class=\"plot\">\n<img src='";
     372
     373    std::stringstream ss;
    372374    for (size_t i=0; i<level_; ++i)
    373       os << "../";
    374     os << "../../../";
     375      ss << "../";
     376    ss << "../../../";
    375377    if (user=="all")
    376       os << stats_[stats_type].plot(imagefile,line_type);
     378      ss << stats_[stats_type].plot(imagefile,line_type);
    377379    else
    378       os << imagefile;
    379     os << "' alt='[plot]' />\n</p>";
     380      ss << imagefile;
     381    os << "<p class=\"plot\">\n";
     382    os << "<object data='" << ss.str() << "' type='image/svg+xml' width='600'\n"
     383       << "<embed src='" << ss.str() << "' type='image/svg+xml' width='600' />\n"
     384       << "</object>\n";
     385    os << "</p>\n";
    380386
    381387    print_author_summary(os, stats_[stats_type], line_type, log);
Note: See TracChangeset for help on using the changeset viewer.