2018-12-29 00:46:47 +08:00
|
|
|
#include "TestWidgetEmptyPlot.h"
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QDate>
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QApplication>
|
2020-09-09 17:26:04 +08:00
|
|
|
#include "jkqtplotter/graphs/jkqtpscatter.h"
|
2018-12-29 00:46:47 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-26 03:16:04 +08:00
|
|
|
JKQTPXYLineGraph* efunc=new JKQTPXYLineGraph(plotEmpty->getPlotter());
|
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;
|
|
|
|
}
|
2019-01-26 20:00:40 +08:00
|
|
|
efunc->setXColumn(plotEmpty->getDatastore()->addCopiedColumn(xef, NEMPTY, "x"));
|
|
|
|
efunc->setYColumn(plotEmpty->getDatastore()->addCopiedColumn(efy, NEMPTY, "y"));
|
2018-12-29 00:46:47 +08:00
|
|
|
plotEmpty->addGraph(efunc);
|
2019-01-26 20:00:40 +08:00
|
|
|
plotEmpty->getYAxis()->setLogAxis(true);
|
2018-12-29 00:46:47 +08:00
|
|
|
plotEmpty->zoomToFit();
|
|
|
|
plotEmpty->setY(0,0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|