00001 #include <qapplication.h>
00002 #include <qwt_plot.h>
00003 #include <qwt_plot_marker.h>
00004 #include <qwt_plot_curve.h>
00005 #include <qwt_legend.h>
00006 #include <qwt_data.h>
00007 #include <qwt_text.h>
00008 #include <math.h>
00009 #include <qdialog.h>
00010
00011 #include <qcolor.h>
00012 #include "plotTS.h"
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 PlotTS::PlotTS(const char *plotTitle, const char *xTitle, const char *yTitle, const char *legend, double *xVal, double *yVal, int nPts)
00023 {
00024
00025 QColor color(255, 255, 255);
00026 setCanvasBackground(color);
00027 setTitle(plotTitle);
00028 insertLegend(new QwtLegend(), QwtPlot::RightLegend);
00029
00030
00031 setAxisTitle(xBottom, xTitle);
00032 setAxisTitle(yLeft, yTitle);
00033
00034
00035 QwtPlotCurve *cSin = new QwtPlotCurve(legend);
00036 #if QT_VERSION >= 0x040000
00037 cSin->setRenderHint(QwtPlotItem::RenderAntialiased);
00038 #endif
00039 cSin->setPen(QPen(Qt::blue));
00040 cSin->attach(this);
00041
00042
00043
00044
00045
00046
00047 cSin->setData(xVal, yVal, nPts);
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 }
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083