-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.h
More file actions
43 lines (39 loc) · 838 Bytes
/
graph.h
File metadata and controls
43 lines (39 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef GRAPH_H
#define GRAPH_H
#include <string>
#include <vector>
#include <sstream>
#include "pair.h"
using namespace std;
class Graph
{
public:
Graph();
void setTitle(string title);
void setVLabel(string vlabel);
void setHLabel(string hlabel);
void setPlottingChar(char plotting_char);
string getTitle();
string getVLabel();
string getHLabel();
char getPlottingChar();
void addData(float x, float y);
void addData(Pair record);
void setConsoleDimensions( int w, int h );
string getGraph( );
private:
vector<Pair> data;
float x_max;
float x_min;
float y_max;
float y_min;
string title;
string vlabel;
string hlabel;
char plotting_char;
void updateMaxMin(float x, float y);
void incrementRows(); // Increase number of rows by one
int width;
int height;
};
#endif