00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "QwtBarCurve.h"
00030
00031 class Matrix;
00032
00034 class QwtHistogram: public QwtBarCurve
00035 {
00036 public:
00037 QwtHistogram(Table *t, const QString& xColName, const QString& name, int startRow, int endRow);
00038 QwtHistogram(Matrix *m);
00039
00040 void copy(QwtHistogram *h);
00041
00042 QwtDoubleRect boundingRect() const;
00043
00044 void setBinning(bool autoBin, double size, double begin, double end);
00045 bool autoBinning(){return d_autoBin;};
00046 double begin(){return d_begin;};
00047 double end(){return d_end;};
00048 double binSize(){return d_bin_size;};
00049
00050 void loadData();
00051 void initData(double* Y, int size);
00052
00053 double mean(){return d_mean;};
00054 double standardDeviation(){return d_standard_deviation;};
00055 double minimum(){return d_min;};
00056 double maximum(){return d_max;};
00057
00058 Matrix* matrix(){return d_matrix;};
00059
00060 private:
00061 void draw(QPainter *painter,const QwtScaleMap &xMap,
00062 const QwtScaleMap &yMap, int from, int to) const;
00063
00064 void loadDataFromMatrix();
00065 Matrix *d_matrix;
00066
00067 bool d_autoBin;
00068 double d_bin_size, d_begin, d_end;
00069
00071 double d_mean, d_standard_deviation, d_min, d_max;
00072 };