mirror of
https://github.com/jkriege2/JKQtPlotter.git
synced 2024-11-16 02:25:50 +08:00
34 lines
830 B
C++
34 lines
830 B
C++
#include "TestWidgetEmptyPlot.h"
|
|
#include <QDebug>
|
|
#include <QDate>
|
|
#include <QDateTime>
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
|
|
TestWidgetEmptyPlot::TestWidgetEmptyPlot(QWidget *parent) :
|
|
QWidget(parent)
|
|
{
|
|
|
|
|
|
#define NEMPTY 500
|
|
|
|
JKQtPlotter* plotEmpty=new JKQtPlotter(true, this);
|
|
JKQTPxyLineGraph* efunc=new JKQTPxyLineGraph(plotEmpty->get_plotter());
|
|
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->getYAxis()->set_logAxis(true);
|
|
plotEmpty->zoomToFit();
|
|
plotEmpty->setY(0,0);
|
|
|
|
|
|
|
|
}
|