curl_stocks
|
Wraps gnuplot to plot stock data. More...
#include <plot.h>
Public Member Functions | |
Plot () | |
Default constructor. | |
Plot (std::string s, float time) | |
Constructor. | |
void | display () const |
Plot data for all stocks. | |
void | display (std::string const &s) const |
Plot data for a single stock. | |
void | setup_gnuplot (Gnuplot &g) const |
Setup options for gnuplot. | |
void | process_data (std::string &s) const |
Figure out which column to plot, comment out first row for gnuplot and remove all carriage returns. | |
void | get_first_datapoint (Gnuplot &g, std::string const &file_name) const |
Calculate furthest point back in time upto which to plot (time_in_weeks). The point is saved in a variable on the command line in gnuplot. | |
void | percentage_plot (Gnuplot &g, std::string const &file_name, const Plot_type type) const |
Plot data from time_in_weeks up until today. Oldest datapoint is normalized for all stocks. | |
void | set_function (std::string const &function) |
Set to daily / weekly / monthly data. | |
void | create_temp_file (std::string const &data, std::string const &file_name) |
Create a file to store stock data. Will be deleted at end of program. | |
void | cleanup () const |
Delete files storing stock data. | |
~Plot () | |
Destructor cleans up temporaray files storing stock data. | |
Static Public Member Functions | |
static float | get_time_in_weeks () |
Getter. | |
Wraps gnuplot to plot stock data.