-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBarPlot.h
More file actions
55 lines (50 loc) · 1.07 KB
/
BarPlot.h
File metadata and controls
55 lines (50 loc) · 1.07 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef BARPLOT_H
#define BARPLOT_H
#include "cppCORE_global.h"
#include <QString>
#include <QHash>
class CPPCORESHARED_EXPORT BarPlot
{
public:
BarPlot();
void setValues(const QList<int>& values, const QList<QString>& labels, const QList<QString>& colors = QList<QString>());
void setValues(const QList<double>& values, const QList<QString>& labels, const QList<QString>& colors = QList<QString>());
void setXLabel(const QString& x_label)
{
xlabel_ = x_label;
}
void setYLabel(const QString& y_label)
{
ylabel_ = y_label;
}
void setDPI(int dpi)
{
dpi_ = dpi;
}
void setXRange(double min, double max)
{
xmin_ = min;
xmax_ = max;
}
void setYRange(double min, double max)
{
ymin_ = min;
ymax_ = max;
}
void addColorLegend(QString color,QString desc);
void store(QString filename);
protected:
//variables to store the plot data
QList<double> bars_;
QList<QString> labels_;
QList<QString> colors_;
QHash<QString,QString> color_legend_;
QString xlabel_;
QString ylabel_;
double ymin_;
double ymax_;
double xmin_;
double xmax_;
int dpi_;
};
#endif