2018-12-29 00:46:47 +08:00
|
|
|
#include "TestWidgetEmptyPlot.h"
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QDate>
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TestWidgetEmptyPlot::TestWidgetEmptyPlot(QWidget *parent) :
|
|
|
|
QWidget(parent)
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
#define NEMPTY 500
|
|
|
|
|
2019-01-20 23:15:10 +08:00
|
|
|
JKQTPlotter* plotEmpty=new JKQTPlotter(true, this);
|
2019-01-20 17:49:29 +08:00
|
|
|
JKQTPXYLineGraph* efunc=new JKQTPXYLineGraph(plotEmpty->get_plotter());
|
2018-12-29 00:46:47 +08:00
|
|
|
double xef[NEMPTY], efy[NEMPTY];
|
|
|
|
for (int i=0; i<NEMPTY; i++) {
|
|
|
|
xef[i]=i;
|
|
|
|
efy[i]=double(i%5)*1e-308;
|
|
|
|
}
|
|
|
|
efunc->set_xColumn(plotEmpty->getDatastore()->addCopiedColumn(xef, NEMPTY, "x"));
|
|
|
|
efunc->set_yColumn(plotEmpty->getDatastore()->addCopiedColumn(efy, NEMPTY, "y"));
|
|
|
|
plotEmpty->addGraph(efunc);
|
|
|
|
plotEmpty->get_yAxis()->set_logAxis(true);
|
|
|
|
plotEmpty->zoomToFit();
|
|
|
|
plotEmpty->setY(0,0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|