diff --git a/README.md b/README.md index d01dfcd08f..1a18260b95 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ All test-projects are Qt-projects that use qmake to build. You can load them int | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest1_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest) | [Very Basic Example (Line Graph)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest) | `JKQTPxyLineGraph`
C-style arrays of data | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_symbols_and_styles_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_symbols_and_styles) | [Line Graph with Different Symbols and Line Styles](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_symbols_and_styles) | `JKQTPxyLineGraph`
C++ vector of data
setting line styles and symbol styles
automatic graph coloring | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_logaxes_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_logaxes) | [logarithmic axes](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_logaxes) | `JKQTPxyLineGraph` and `JKQTPgeoText`
C++ vector of data
logarithmic axes
plot line styles
internal LaTeX parser
add commenting text to a graph | +| [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_dateaxes_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_dateaxes) | [date/time axes](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_dateaxes) | `JKQTPxyLineGraph` and ``
C++ vector of data
date/time axes
plot min/max range graph
internal LaTeX parser
data from CSV files | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_symbols_and_errors_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_symbols_and_errors) | [Simple Line/Symbol Graph With Errorbars](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_symbols_and_errors) | `JKQTPxyLineErrorGraph`
C-style arrays of data | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_barchart_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_barchart) | [Simple Bar Charts](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_barchart) | `JKQTPbarVerticalGraph`
C-style arrays of data | | [![](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/JKQTPbarVerticalGraphStacked_small.png)](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_stackedbars) | [Stacked Bar Charts](https://github.com/jkriege2/JKQtPlotter/tree/master/test/jkqtplotter_simpletest_stackedbars) | `JKQTPbarVerticalStackableGraph`, `JKQTPbarHorizontalStackableGraph`
C++-style vectors of data | diff --git a/doc/images/JKQTPfilledVerticalRangeGraph.png b/doc/images/JKQTPfilledVerticalRangeGraph.png new file mode 100644 index 0000000000..55c20242d4 Binary files /dev/null and b/doc/images/JKQTPfilledVerticalRangeGraph.png differ diff --git a/doc/images/JKQTPfilledVerticalRangeGraph_WithLines.png b/doc/images/JKQTPfilledVerticalRangeGraph_WithLines.png new file mode 100644 index 0000000000..ed35d14616 Binary files /dev/null and b/doc/images/JKQTPfilledVerticalRangeGraph_WithLines.png differ diff --git a/doc/images/jkqtplotter_simpletest_dateaxes.png b/doc/images/jkqtplotter_simpletest_dateaxes.png new file mode 100644 index 0000000000..db7ebb99f3 Binary files /dev/null and b/doc/images/jkqtplotter_simpletest_dateaxes.png differ diff --git a/lib/jkqtplotter/jkqtpbaseelements.cpp b/lib/jkqtplotter/jkqtpbaseelements.cpp index a277718b91..3e1690fd05 100644 --- a/lib/jkqtplotter/jkqtpbaseelements.cpp +++ b/lib/jkqtplotter/jkqtpbaseelements.cpp @@ -255,9 +255,9 @@ void JKQTPcoordinateAxis::loadSettings(QSettings& settings, QString group) { JKQTPPROPERTYload(settings, group+axisPrefix, minorTickLabelFontSize, "minor_tick_label_font_size", toDouble()); JKQTPPROPERTYload(settings, group+axisPrefix, minorTickLabelFullNumber, "minor_tick_label_full_number", toBool()); - JKQTPPROPERTYload(settings, group+axisPrefix, tickTimeFormat, "tick_time_format", toDouble()); - JKQTPPROPERTYload(settings, group+axisPrefix, tickDateFormat, "tick_date_format", toDouble()); - JKQTPPROPERTYload(settings, group+axisPrefix, tickDateTimeFormat, "tick_datetime_format", toDouble()); + JKQTPPROPERTYload(settings, group+axisPrefix, tickTimeFormat, "tick_time_format", toString()); + JKQTPPROPERTYload(settings, group+axisPrefix, tickDateFormat, "tick_date_format", toString()); + JKQTPPROPERTYload(settings, group+axisPrefix, tickDateTimeFormat, "tick_datetime_format", toString()); JKQTPPROPERTYload(settings, group+axisPrefix, minTicks, "min_ticks", toUInt()); @@ -577,17 +577,17 @@ QString JKQTPcoordinateAxis::floattolabel(double data) { }; break; case JKQTPCALTdate: { QDateTime dt; - dt.setMSecsSinceEpoch(uint(data)); + dt.setMSecsSinceEpoch(uint64_t(data)); return dt.toString(tickDateFormat); }; break; case JKQTPCALTtime: { QDateTime dt; - dt.setMSecsSinceEpoch(uint(data)); + dt.setMSecsSinceEpoch(uint64_t(data)); return dt.toString(tickTimeFormat); }; break; case JKQTPCALTdatetime: { QDateTime dt; - dt.setMSecsSinceEpoch(uint(data)); + dt.setMSecsSinceEpoch(uint64_t(data)); return dt.toString(tickDateTimeFormat); }; break; default: diff --git a/lib/jkqtplotter/jkqtpbaseelements.h b/lib/jkqtplotter/jkqtpbaseelements.h index 062585be94..b07b92704a 100644 --- a/lib/jkqtplotter/jkqtpbaseelements.h +++ b/lib/jkqtplotter/jkqtpbaseelements.h @@ -650,11 +650,11 @@ class LIB_EXPORT JKQTPcoordinateAxis: public QObject { JKQTPPROPERTY(double, lineWidthZeroAxis) - /** \brief format string for time tick labels */ + /** \brief format string for time tick labels, see see QDateTime::toString() documentation for details on format strings */ JKQTPPROPERTY(QString, tickTimeFormat) - /** \brief format string for date tick labels */ + /** \brief format string for date tick labels, see see QDateTime::toString() documentation for details on format strings */ JKQTPPROPERTY(QString, tickDateFormat) - /** \brief format string for datetime tick labels */ + /** \brief format string for datetime tick labels, see see QDateTime::toString() documentation for details on format strings */ JKQTPPROPERTY(QString, tickDateTimeFormat) /** \brief calculates the tick spacing for a linear axis that spans \a awidth and that should diff --git a/lib/jkqtplotter/jkqtpelements.cpp b/lib/jkqtplotter/jkqtpelements.cpp index e7d9e284e7..ad57987b0c 100644 --- a/lib/jkqtplotter/jkqtpelements.cpp +++ b/lib/jkqtplotter/jkqtpelements.cpp @@ -2388,3 +2388,241 @@ bool JKQTPxyParametrizedErrorScatterGraph::intPlotXYErrorIndicatorsGetColor(JKQT } + +JKQTPfilledVerticalRangeGraph::JKQTPfilledVerticalRangeGraph(JKQtBasePlotter *parent): + JKQTPxyGraph(parent) +{ + drawSelectionLine=false; + selectionLineColor=Qt::transparent; + color=QColor("red"); + fillColor=color.lighter(); + style=Qt::SolidLine; + lineWidth=2; + parentPlotStyle=-1; + drawLine=true; + fillStyle=Qt::SolidPattern; + + if (parent) { // get style settings from parent object + parentPlotStyle=parent->getNextStyle(); + //std::cout<<"got style settings from parent: "<getPlotStyle(parentPlotStyle).color(); + style=parent->getPlotStyle(parentPlotStyle).style(); + fillColor=color.lighter(); + } +} + +JKQTPfilledVerticalRangeGraph::JKQTPfilledVerticalRangeGraph(JKQtPlotter *parent): + JKQTPxyGraph(parent) +{ + drawSelectionLine=false; + selectionLineColor=Qt::transparent; + color=QColor("red"); + fillColor=color.lighter(); + style=Qt::SolidLine; + lineWidth=2; + parentPlotStyle=-1; + drawLine=true; + fillStyle=Qt::SolidPattern; + + if (parent) { // get style settings from parent object + parentPlotStyle=parent->getNextStyle(); + //std::cout<<"got style settings from parent: "<getPlotStyle(parentPlotStyle).color(); + style=parent->getPlotStyle(parentPlotStyle).style(); + fillColor=color.lighter(); + } +} + +bool JKQTPfilledVerticalRangeGraph::getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) +{ + bool start=true; + miny=0; + maxy=0; + smallestGreaterZero=0; + + if (parent==nullptr) return false; + + JKQTPdatastore* datastore=parent->getDatastore(); + int imin=0; + int imax=qMin(qMin(datastore->getColumn(static_cast(xColumn)).getRows(), datastore->getColumn(static_cast(yColumn)).getRows()), datastore->getColumn(static_cast(yColumn2)).getRows()); + // interpret data ranges + if (datarange_start>-1) { + imin=qMin(datarange_start, static_cast(imax)); + } + if (datarange_end>-1) { + imax=qMin(datarange_end, static_cast(imax)); + } + if (imaxget(static_cast(yColumn),static_cast(i)); + double yv2=datastore->get(static_cast(yColumn2),static_cast(i)); + if (JKQTPIsOKFloat(yv)) { + if (start || yv>maxy) maxy=yv; + if (start || yvmaxy) maxy=yv2; + if (start || yv2getDatastore(); + if (datastore==nullptr) return; + + drawErrorsBefore(painter); + + painter.save(); + + QPen p=painter.pen(); + p.setColor(color); + p.setWidthF(qMax(JKQTPLOTTER_ABS_MIN_LINEWIDTH, parent->pt2px(painter, lineWidth*parent->get_lineWidthMultiplier()))); + p.setStyle(style); + p.setJoinStyle(Qt::RoundJoin); + p.setCapStyle(Qt::RoundCap); + QPen np(Qt::NoPen); + + QBrush b=painter.brush(); + b.setColor(fillColor); + b.setStyle(fillStyle); + + int imax=qMin(qMin(datastore->getColumn(static_cast(xColumn)).getRows(), datastore->getColumn(static_cast(yColumn)).getRows()), datastore->getColumn(static_cast(yColumn2)).getRows()); + int imin=0; + // interpret data ranges + if (datarange_start>-1) { + imin=qMin(datarange_start, static_cast(imax)); + } + if (datarange_end>-1) { + imax=qMin(datarange_end, static_cast(imax)); + } + if (imaxget(static_cast(xColumn),static_cast(i)); + double yv=datastore->get(static_cast(yColumn),static_cast(i)); + double yv2=datastore->get(static_cast(yColumn2),static_cast(i)); + //std::cout<<"(xv, yv) = ( "<x2p(xv); bool xok=JKQTPIsOKFloat(x); + double y=yAxis->x2p(yv); bool yok=JKQTPIsOKFloat(y); + double y2=yAxis->x2p(yv2); bool y2ok=JKQTPIsOKFloat(y2); + + if (xok&&yok) phigh.append(QPointF(x,y)); + if (xok&&yok) poly_all.append(QPointF(x,y)); + if (xok&&y2ok) plow.append(QPointF(x,y2)); + } + } + + if (plow.size()>0) { + for (int i=plow.size()-1; i>=0; i--) { + poly_all.append(plow[i]); + } + } + painter.setBrush(b); + painter.setPen(np); + painter.drawPolygon(poly_all); + + painter.restore(); + if (drawLine) { + painter.save(); + + if (drawSelectionLine) { + QPen penSelection=p; penSelection.setStyle(Qt::SolidLine); + QColor selcol=penSelection.color(); selcol.setAlphaF(0.5); penSelection.setColor(selcol); + if (selectionLineColor!=Qt::transparent) { + penSelection.setColor(selectionLineColor); + } + penSelection.setWidthF(penSelection.widthF()*3.0); + painter.setPen(penSelection); + painter.drawPolyline(phigh); + painter.drawPolyline(plow); + } + + + painter.setPen(p); + painter.drawPolyline(phigh); + painter.drawPolyline(plow); + painter.restore(); + } + + drawErrorsAfter(painter); +} + +void JKQTPfilledVerticalRangeGraph::drawKeyMarker(JKQTPEnhancedPainter &painter, QRectF &rect) +{ + painter.save(); + QRectF r=rect; + r.setHeight(r.height()/2.0); + r.moveTo(r.x(), r.y()+r.height()-1); + painter.fillRect(r, getBrush(painter)); + if (drawLine) { + painter.setPen(getLinePen(painter)); + painter.drawLine(QLineF(r.topLeft(), r.topRight())); + } + painter.restore(); +} + +QColor JKQTPfilledVerticalRangeGraph::getKeyLabelColor() +{ + return color; +} + +QBrush JKQTPfilledVerticalRangeGraph::getBrush(JKQTPEnhancedPainter &painter) const +{ + QBrush b; + b.setColor(fillColor); + b.setStyle(fillStyle); + return b; +} + +QPen JKQTPfilledVerticalRangeGraph::getLinePen(JKQTPEnhancedPainter &painter) const +{ + QPen p; + p.setColor(color); + p.setWidthF(qMax(JKQTPLOTTER_ABS_MIN_LINEWIDTH, parent->pt2px(painter, lineWidth*parent->get_lineWidthMultiplier()))); + p.setStyle(style); + p.setJoinStyle(Qt::RoundJoin); + p.setCapStyle(Qt::RoundCap); + return p; +} diff --git a/lib/jkqtplotter/jkqtpelements.h b/lib/jkqtplotter/jkqtpelements.h index 02a82a96cc..466ea3a27f 100644 --- a/lib/jkqtplotter/jkqtpelements.h +++ b/lib/jkqtplotter/jkqtpelements.h @@ -605,6 +605,84 @@ class LIB_EXPORT JKQTPfilledCurveYErrorGraph: public JKQTPfilledCurveYGraph, pub + +/*! \brief This implements filled curve plots where the area is filled between two data columns for each x-value + \ingroup jkqtplotter_plots + + With set_drawlines(false): + \image html JKQTPfilledVerticalRangeGraph.png + + With set_drawlines(true): + \image html JKQTPfilledVerticalRangeGraph_WithLines.png + */ +class LIB_EXPORT JKQTPfilledVerticalRangeGraph: public JKQTPxyGraph { + Q_OBJECT + public: + /** \brief class constructor */ + JKQTPfilledVerticalRangeGraph(JKQtBasePlotter* parent=nullptr); + /** \brief class constructor */ + JKQTPfilledVerticalRangeGraph(JKQtPlotter* parent); + /** \brief get the maximum and minimum y-value of the graph + * + * The result is given in the two parameters which are call-by-reference parameters! + */ + virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero); + + /** \copydoc JKQTPgraph::usesColumn() */ + virtual bool usesColumn(int column); + + /** \brief plots the graph to the plotter object specified as parent */ + virtual void draw(JKQTPEnhancedPainter& painter); + /** \brief plots a key marker inside the specified rectangle \a rect */ + virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, QRectF& rect); + /** \brief returns the color to be used for the key label */ + virtual QColor getKeyLabelColor(); + + JKQTPGET_SET_MACRO(int, yColumn2) + JKQTPSET_CAST_MACRO(size_t, int, yColumn2) + + JKQTPGET_SET_MACRO(QColor, color) + JKQTPGET_SET_MACRO(QColor, fillColor) + JKQTPGET_SET_MACRO(Qt::PenStyle, style) + JKQTPGET_SET_MACRO(bool, drawLine) + JKQTPGET_SET_MACRO(Qt::BrushStyle, fillStyle) + + JKQTPGET_SET_MACRO(bool, drawSelectionLine) + JKQTPGET_SET_MACRO(QColor, selectionLineColor) + + protected: + + /** \brief the column that contains the second y-component of the range */ + int yColumn2; + /** \brief if \c true, draws a thick shadow around the line*/ + bool drawSelectionLine; + /** \brief color for the shadow, or a lighter version of the line color, if transparent (default) */ + QColor selectionLineColor; + + /** \brief which plot style to use from the parent plotter (via JKQtPlotterBase::getPlotStyle() and JKQtPlotterBase::getNextStyle() ) */ + int parentPlotStyle; + + /** \brief color of the graph */ + QColor color; + /** \brief color of the graph fill */ + QColor fillColor; + /** \brief fill styl for the curve */ + Qt::BrushStyle fillStyle; + /** \brief linestyle of the graph lines */ + Qt::PenStyle style; + /** \brief width (pixels) of the graph */ + double lineWidth; + /** \brief indicates whether to draw a line or not */ + bool drawLine; + + QBrush getBrush(JKQTPEnhancedPainter& painter) const; + QPen getLinePen(JKQTPEnhancedPainter& painter) const; +}; + + + + + /*! \brief This implements a step plot with values \f$ \left(x, f(x) \right) \f$ \ingroup jkqtplotter_plots diff --git a/screenshots/jkqtplotter_simpletest_dateaxes.png b/screenshots/jkqtplotter_simpletest_dateaxes.png new file mode 100644 index 0000000000..a166699e85 Binary files /dev/null and b/screenshots/jkqtplotter_simpletest_dateaxes.png differ diff --git a/screenshots/jkqtplotter_simpletest_dateaxes_small.png b/screenshots/jkqtplotter_simpletest_dateaxes_small.png new file mode 100644 index 0000000000..fbb57c3451 Binary files /dev/null and b/screenshots/jkqtplotter_simpletest_dateaxes_small.png differ diff --git a/screenshots/jkqtplotter_simpletest_dateaxes_timeaxis.png b/screenshots/jkqtplotter_simpletest_dateaxes_timeaxis.png new file mode 100644 index 0000000000..daa408af8f Binary files /dev/null and b/screenshots/jkqtplotter_simpletest_dateaxes_timeaxis.png differ diff --git a/test/jkqtplotter_simpletest_dateaxes/README.md b/test/jkqtplotter_simpletest_dateaxes/README.md new file mode 100644 index 0000000000..fc79925abf --- /dev/null +++ b/test/jkqtplotter_simpletest_dateaxes/README.md @@ -0,0 +1,171 @@ +[Back to JKQTPlotter main page](https://github.com/jkriege2/JKQtPlotter/) + +# JKQtPlotter + +## Date/Time Axes + +### Date Axis +This project (see `./test/jkqtplotter_simpletest_dateaxes/`) simply creates a JKQtPlotter widget (as a new window) with the X-axis showing time or date(-time) values, formated as such. + +The source code of the main application can be found in [`jkqtplotter_simpletest_dateaxes.cpp`](https://github.com/jkriege2/JKQtPlotter/blob/master/test/jkqtplotter_simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.cpp). + +First some data is parsed from a CSV-file (added as ressource to the example). Note that the Time/date or Date+Time data is internally stored as milliseconds since epoc (Jan 1st 1970, 00:00:00), therefore data has to be converted accordingly before beeing added to the graph. + +```c++ + QVector date; + QVector temperature, temperature_min, temperature_max; + // parse a textfile with comments on the first line and the + // semicolon separated data. The first column is a date and time + // the second to fourth columns contain a floating-point number + // with temperature average, min and max + QFile file(":/weatherdata_gelsenkirchen.csv"); + file.open(QFile::ReadOnly|QFile::Text); + file.readLine(); // eat comment + while (!file.atEnd()) { + QString line=file.readLine(); + QTextStream in(&line); + QStringList items=line.split(";"); + // date/time values are stored as doubles representing the corresponding number of milliseconds sind epoch + date<addCopiedColumn(date, "date"); + graphTemperatureRange->set_xColumn(colDate); + graphTemperatureRange->set_yColumn(ds->addCopiedColumn(temperature_min, "temperature_min")); + graphTemperatureRange->set_yColumn2(ds->addCopiedColumn(temperature_max, "temperature_max")); + + + // 5. min/max range data + // graph fill color is a lighter shade of the average graph + graphTemperatureRange->set_fillColor(graphTemperature->get_color().lighter()); + // don't draw lines of the data + graphTemperatureRange->set_drawLine(false); + // plot label in key + graphTemperatureRange->set_title("Min/Max Temperature"); + // add the graph to the plot, so it is actually displayed + plot.addGraph(graphTemperatureRange); +``` + +On top of that plot, a second plot is added, which draws the average temperatures of each month as a line: + +```c++ + // 3. add a plot for the data mean line (graphTemperature) and range (graphTemperatureRange) + JKQTPxyLineErrorGraph* graphTemperature=new JKQTPxyLineErrorGraph(&plot); + + // 4. copy data into datastore and immediately set the yColumn + size_t colDate=ds->addCopiedColumn(date, "date"); + graphTemperature->set_xColumn(colDate); + graphTemperature->set_yColumn(ds->addCopiedColumn(temperature, "temperature")); + + + // 5. min/max range data + // .... see above + + // 6. average data + // don't use symbols + graphTemperature->set_symbol(JKQTPnoSymbol); + // set the line width + graphTemperature->set_lineWidth(1); + // draw small symbols + graphTemperature->set_symbolSize(6); + // graph title + graphTemperature->set_title("Average Temperature"); + // add the graph to the plot, so it is actually displayed + plot.addGraph(graphTemperature); +``` + +Finally the x-axis is formatted to display dates (see [Qt-Documentation of `QDateTime::toString()`](http://doc.qt.io/qt-5/qdatetime.html#toString) for details on the formating strings): +```c++ + // 7. format the plot + // set the title above the plot, use LaTeX instructions to make text bold + plot.get_plotter()->set_plotLabel("\\textbf{Weather in Gelsenkirchen, 2017-2018}"); + // set x-axis date-time-axis + plot.getXAxis()->set_labelType(JKQTPCALTdatetime); + plot.getXAxis()->set_axisLabel("Date"); + // set format string for date axis (e.g. Jan '18), see Documentation of QDateTime::toString() + plot.getXAxis()->set_tickDateTimeFormat("MMM ''yy"); + // set y-axis temperature axis + plot.getYAxis()->set_axisLabel("Average Daily Temperature [{\\degree}C]"); +``` + +The result looks like this: + +![jkqtplotter_simpletest_symbols_and_styles](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_dateaxes.png) + + +### Time Axis +A second variant (see the example CPP-file) displays data with a time-axis: + +![jkqtplotter_simpletest_symbols_and_styles](https://raw.githubusercontent.com/jkriege2/JKQtPlotter/master/screenshots/jkqtplotter_simpletest_dateaxes_timeaxis.png) + + +For that example data-pasring is a bit different, because the file only contains times and no dates: +```c++ + // 2. now we create data vectors with data parsed from a CSV-file + QVector time; + QVector temperature; + // parse a textfile with comments on the first line and the + // semicolon separated data. The first column is a time + // the second contain a floating-point number with temperatures + QFile file(":/weatherdata_heidelberg_2018-10-14.csv"); + file.open(QFile::ReadOnly|QFile::Text); + file.readLine(); // eat comment + while (!file.atEnd()) { + QString line=file.readLine(); + QTextStream in(&line); + QStringList items=line.split(";"); + // date/time values are stored as doubles representing the corresponding + // number of milliseconds sind epoch. Since the data is time only, we have to use an arbitrary + // date as basis + time<set_plotLabel("\\textbf{Weather in Heidelberg, 14^{th} Oct 2018}"); + // set x-axis date-time-axis + plot.getXAxis()->set_labelType(JKQTPCALTtime); + plot.getXAxis()->set_axisLabel("Time of Day"); + // set format string for time axis with 24-hour and minute only, + // see QDateTime::toString() documentation for details on format strings + plot.getXAxis()->set_tickTimeFormat("HH:mm"); + // set y-axis temperature axis + plot.getYAxis()->set_axisLabel("Temperature [{\\degree}C]"); +``` + +[Back to JKQTPlotter main page](https://github.com/jkriege2/JKQtPlotter/) \ No newline at end of file diff --git a/test/jkqtplotter_simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.cpp b/test/jkqtplotter_simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.cpp new file mode 100644 index 0000000000..e650ac21af --- /dev/null +++ b/test/jkqtplotter_simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.cpp @@ -0,0 +1,172 @@ +#include +#include +#include +#include +#include +#include "jkqtplotter/jkqtplotter.h" +#include "jkqtplotter/jkqtpgeoelements.h" +#include "jkqtplottertools/jkqtptools.h" + +void drawWithDateAxis(JKQtPlotter& plot) { + + // 1. create a plotter window and get a pointer to the internal datastore (for convenience) + JKQTPdatastore* ds=plot.getDatastore(); + + // 2. now we create data vectors with data parsed from a CSV-file + QVector date; + QVector temperature, temperature_min, temperature_max; + // parse a textfile with comments on the first line and the + // semicolon separated data. The first column is a date and time + // the second to fourth columns contain a floating-point number + // with temperature average, min and max + QFile file(":/weatherdata_gelsenkirchen.csv"); + file.open(QFile::ReadOnly|QFile::Text); + file.readLine(); // eat comment + while (!file.atEnd()) { + QString line=file.readLine(); + QTextStream in(&line); + QStringList items=line.split(";"); + // date/time values are stored as doubles representing the corresponding number of milliseconds sind epoch + date<addCopiedColumn(date, "date"); + graphTemperature->set_xColumn(colDate); + graphTemperature->set_yColumn(ds->addCopiedColumn(temperature, "temperature")); + graphTemperatureRange->set_xColumn(colDate); + graphTemperatureRange->set_yColumn(ds->addCopiedColumn(temperature_min, "temperature_min")); + graphTemperatureRange->set_yColumn2(ds->addCopiedColumn(temperature_max, "temperature_max")); + + + // 5. min/max range data + // graph fill color is a lighter shade of the average graph + graphTemperatureRange->set_fillColor(graphTemperature->get_color().lighter()); + // don't draw lines of the data + graphTemperatureRange->set_drawLine(false); + // plot label in key + graphTemperatureRange->set_title("Min/Max Temperature"); + // add the graph to the plot, so it is actually displayed + plot.addGraph(graphTemperatureRange); + + // 6. average data + // don't use symbols + graphTemperature->set_symbol(JKQTPnoSymbol); + // set the line width + graphTemperature->set_lineWidth(1); + // draw small symbols + graphTemperature->set_symbolSize(6); + // graph title + graphTemperature->set_title("Average Temperature"); + // add the graph to the plot, so it is actually displayed + plot.addGraph(graphTemperature); + + + // 7. format the plot + // set the title above the plot, use LaTeX instructions to make text bold + plot.get_plotter()->set_plotLabel("\\textbf{Weather in Gelsenkirchen, 2017-2018}"); + // set x-axis date-time-axis + plot.getXAxis()->set_labelType(JKQTPCALTdatetime); + plot.getXAxis()->set_axisLabel("Date"); + // set format string for date axis (e.g. Jan '18), see Documentation of QDateTime::toString() + plot.getXAxis()->set_tickDateTimeFormat("MMM ''yy"); + // set y-axis temperature axis + plot.getYAxis()->set_axisLabel("Average Daily Temperature [{\\degree}C]"); + + // 8. autoscale the plot so the graph is contained + plot.zoomToFit(); + + // 9. show plotter and make it a decent size + plot.show(); + plot.resize(600,400); + plot.setWindowTitle("Date Axis"); +} + +void drawWithTimeAxis(JKQtPlotter& plot) { + // 1. create a plotter window and get a pointer to the internal datastore (for convenience) + JKQTPdatastore* ds=plot.getDatastore(); + + // 2. now we create data vectors with data parsed from a CSV-file + QVector time; + QVector temperature; + // parse a textfile with comments on the first line and the + // semicolon separated data. The first column is a time + // the second contain a floating-point number with temperatures + QFile file(":/weatherdata_heidelberg_2018-10-14.csv"); + file.open(QFile::ReadOnly|QFile::Text); + file.readLine(); // eat comment + while (!file.atEnd()) { + QString line=file.readLine(); + QTextStream in(&line); + QStringList items=line.split(";"); + // date/time values are stored as doubles representing the corresponding + // number of milliseconds sind epoch. Since the data is time only, we have to use an arbitrary + // date as basis + time<addCopiedColumn(time, "time"); + graphTemperature->set_xColumn(colDate); + graphTemperature->set_yColumn(ds->addCopiedColumn(temperature, "temperature")); + + + // 6. average data + // don't use symbols + graphTemperature->set_symbol(JKQTPcross); + // set the line width + graphTemperature->set_lineWidth(1); + // draw small symbols + graphTemperature->set_symbolSize(6); + // graph title + graphTemperature->set_title("Average Temperature"); + // add the graph to the plot, so it is actually displayed + plot.addGraph(graphTemperature); + + + // 7. format the plot + // set the title above the plot, use LaTeX instructions to make text bold + plot.get_plotter()->set_plotLabel("\\textbf{Weather in Heidelberg, 14^{th} Oct 2018}"); + // set x-axis date-time-axis + plot.getXAxis()->set_labelType(JKQTPCALTtime); + plot.getXAxis()->set_axisLabel("Time of Day"); + // set format string for time axis with 24-hour and minute only, + // see QDateTime::toString() documentation for details on format strings + plot.getXAxis()->set_tickTimeFormat("HH:mm"); + // set y-axis temperature axis + plot.getYAxis()->set_axisLabel("Temperature [{\\degree}C]"); + + // 8. autoscale the plot so the graph is contained + plot.zoomToFit(); + + // 9. show plotter and make it a decent size + plot.show(); + plot.resize(600,400); + plot.setWindowTitle("Time Axis"); +} + +int main(int argc, char* argv[]) +{ + QApplication app(argc, argv); + JKQtPlotter plotDate; + drawWithDateAxis(plotDate); + plotDate.move(100,100); + JKQtPlotter plotTime; + drawWithTimeAxis(plotTime); + plotTime.move(100,550); + + return app.exec(); +} diff --git a/test/jkqtplotter_simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.pro b/test/jkqtplotter_simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.pro new file mode 100644 index 0000000000..85bb6ee6f3 --- /dev/null +++ b/test/jkqtplotter_simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.pro @@ -0,0 +1,20 @@ +# source code for this simple demo +SOURCES = jkqtplotter_simpletest_dateaxes.cpp + +# configure Qt +CONFIG += qt +QT += core gui svg +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport + +# output executable name +TARGET = jkqtplotter_simpletest_dateaxes + +# include JKQtPlotter source code +include(../../lib/jkqtplotter.pri) + +# here you can activate some debug options +#DEFINES += SHOW_JKQTPLOTTER_DEBUG +#DEFINES += JKQTBP_AUTOTIMER + +RESOURCES += \ + jkqtplotter_simpletest_dateaxes.qrc diff --git a/test/jkqtplotter_simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.qrc b/test/jkqtplotter_simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.qrc new file mode 100644 index 0000000000..93bf12d449 --- /dev/null +++ b/test/jkqtplotter_simpletest_dateaxes/jkqtplotter_simpletest_dateaxes.qrc @@ -0,0 +1,7 @@ + + + weatherdata_gelsenkirchen.csv + weatherdata_heidelberg_2018-10-14.csv + weatherdata_heidelberg.csv + + diff --git a/test/jkqtplotter_simpletest_dateaxes/weatherdata_gelsenkirchen.csv b/test/jkqtplotter_simpletest_dateaxes/weatherdata_gelsenkirchen.csv new file mode 100644 index 0000000000..766bd02b6d --- /dev/null +++ b/test/jkqtplotter_simpletest_dateaxes/weatherdata_gelsenkirchen.csv @@ -0,0 +1,24 @@ +Datum;Zeit;Temp_mean[degC];Temp_min[degC];Temp_max[degC]; data from http://wetter.mpg-ge.de/NOAA/NOAA-2018.txt and http://wetter.mpg-ge.de/NOAA/NOAA-2017.txt +2017-01-15T12:00; 1.2; -1.2; 3.7 +2017-02-15T12:00; 5.6; 3.2; 8.1 +2017-03-15T12:00; 9.6; 6.2; 13.5 +2017-04-15T12:00; 8.9; 5.1; 12.9 +2017-05-15T12:00; 16.0; 11.4; 20.8 +2017-06-15T12:00; 19.2; 15.0; 23.5 +2017-07-15T12:00; 19.1; 15.2; 23.4 +2017-08-15T12:00; 18.5; 14.7; 22.5 +2017-09-15T12:00; 14.4; 11.4; 18.3 +2017-10-15T12:00; 13.1; 10.8; 16.0 +2017-11-15T12:00; 7.5; 5.6; 9.7 +2017-12-15T12:00; 4.2; 2.6; 5.9 +2018-01-15T12:00; 5.7; 3.7; 7.8 +2018-02-15T12:00; 0.4; -1.9; 3.2 +2018-03-15T12:00; 5.0; 1.5; 8.5 +2018-04-15T12:00; 14.3; 9.8; 18.9 +2018-05-15T12:00; 16.7; 12.3; 21.2 +2018-06-15T12:00; 18.3; 14.5; 22.7 +2018-07-15T12:00; 22.2; 16.4; 27.9 +2018-08-15T12:00; 20.5; 15.9; 25.6 +2018-09-15T12:00; 16.2; 12.1; 20.8 +2018-10-15T12:00; 13.0; 9.6; 17.0 +2018-11-15T12:00; 7.2; 4.8; 10.0 diff --git a/test/jkqtplotter_simpletest_dateaxes/weatherdata_heidelberg.csv b/test/jkqtplotter_simpletest_dateaxes/weatherdata_heidelberg.csv new file mode 100644 index 0000000000..7a345b510b --- /dev/null +++ b/test/jkqtplotter_simpletest_dateaxes/weatherdata_heidelberg.csv @@ -0,0 +1,289 @@ +2018-10-14T00:00:00; 24.2 +2018-10-14T00:10:00; 24.2 +2018-10-14T00:20:00; 24.1 +2018-10-14T00:30:00; 24.1 +2018-10-14T00:40:00; 24.1 +2018-10-14T00:50:00; 24.0 +2018-10-14T01:00:00; 24.0 +2018-10-14T01:10:00; 24.0 +2018-10-14T01:20:00; 24.0 +2018-10-14T01:30:00; 24.0 +2018-10-14T01:40:00; 23.9 +2018-10-14T01:50:00; 23.9 +2018-10-14T02:00:00; 23.8 +2018-10-14T02:10:00; 23.8 +2018-10-14T02:20:00; 23.8 +2018-10-14T02:30:00; 23.8 +2018-10-14T02:40:00; 23.8 +2018-10-14T02:50:00; 23.7 +2018-10-14T03:00:00; 23.7 +2018-10-14T03:10:00; 23.7 +2018-10-14T03:20:00; 23.6 +2018-10-14T03:30:00; 23.6 +2018-10-14T03:40:00; 23.6 +2018-10-14T03:50:00; 23.6 +2018-10-14T04:00:00; 23.6 +2018-10-14T04:10:00; 23.6 +2018-10-14T04:20:00; 23.6 +2018-10-14T04:30:00; 23.6 +2018-10-14T04:40:00; 23.6 +2018-10-14T04:50:00; 23.5 +2018-10-14T05:00:00; 23.5 +2018-10-14T05:10:00; 23.5 +2018-10-14T05:20:00; 23.4 +2018-10-14T05:30:00; 23.4 +2018-10-14T05:40:00; 23.4 +2018-10-14T05:50:00; 23.4 +2018-10-14T06:00:00; 23.4 +2018-10-14T06:10:00; 23.4 +2018-10-14T06:20:00; 23.4 +2018-10-14T06:30:00; 23.4 +2018-10-14T06:40:00; 23.4 +2018-10-14T06:50:00; 23.4 +2018-10-14T07:00:00; 23.4 +2018-10-14T07:10:00; 23.4 +2018-10-14T07:20:00; 23.4 +2018-10-14T07:30:00; 23.4 +2018-10-14T07:40:00; 23.4 +2018-10-14T07:50:00; 23.4 +2018-10-14T08:00:00; 23.4 +2018-10-14T08:10:00; 23.3 +2018-10-14T08:20:00; 23.3 +2018-10-14T08:30:00; 23.2 +2018-10-14T08:40:00; 23.2 +2018-10-14T08:50:00; 23.2 +2018-10-14T09:00:00; 23.1 +2018-10-14T09:10:00; 23.1 +2018-10-14T09:20:00; 23.0 +2018-10-14T09:30:00; 23.0 +2018-10-14T09:40:00; 23.0 +2018-10-14T09:50:00; 23.1 +2018-10-14T10:00:00; 23.1 +2018-10-14T10:10:00; 23.2 +2018-10-14T10:20:00; 23.2 +2018-10-14T10:30:00; 23.3 +2018-10-14T10:40:00; 23.4 +2018-10-14T10:50:00; 23.5 +2018-10-14T11:00:00; 23.6 +2018-10-14T11:10:00; 23.8 +2018-10-14T11:20:00; 24.0 +2018-10-14T11:30:00; 24.3 +2018-10-14T11:40:00; 24.6 +2018-10-14T11:50:00; 24.9 +2018-10-14T12:00:00; 25.3 +2018-10-14T12:10:00; 25.6 +2018-10-14T12:20:00; 25.8 +2018-10-14T12:30:00; 25.8 +2018-10-14T12:40:00; 25.8 +2018-10-14T12:50:00; 25.8 +2018-10-14T13:00:00; 25.8 +2018-10-14T13:10:00; 25.9 +2018-10-14T13:20:00; 26.1 +2018-10-14T13:30:00; 26.3 +2018-10-14T13:40:00; 26.5 +2018-10-14T13:50:00; 26.6 +2018-10-14T14:00:00; 26.8 +2018-10-14T14:10:00; 26.9 +2018-10-14T14:20:00; 27.0 +2018-10-14T14:30:00; 27.2 +2018-10-14T14:40:00; 27.2 +2018-10-14T14:50:00; 27.4 +2018-10-14T15:00:00; 27.4 +2018-10-14T15:10:00; 27.4 +2018-10-14T15:20:00; 27.4 +2018-10-14T15:30:00; 27.5 +2018-10-14T15:40:00; 27.5 +2018-10-14T15:50:00; 27.5 +2018-10-14T16:00:00; 27.5 +2018-10-14T16:10:00; 27.4 +2018-10-14T16:20:00; 27.3 +2018-10-14T16:30:00; 27.0 +2018-10-14T16:40:00; 26.8 +2018-10-14T16:50:00; 26.0 +2018-10-14T17:00:00; 25.5 +2018-10-14T17:10:00; 25.3 +2018-10-14T17:20:00; 25.1 +2018-10-14T17:30:00; 24.9 +2018-10-14T17:40:00; 24.7 +2018-10-14T17:50:00; 24.5 +2018-10-14T18:00:00; 24.3 +2018-10-14T18:10:00; 24.2 +2018-10-14T18:20:00; 24.1 +2018-10-14T18:30:00; 24.0 +2018-10-14T18:40:00; 23.8 +2018-10-14T18:50:00; 23.8 +2018-10-14T19:00:00; 23.7 +2018-10-14T19:10:00; 23.6 +2018-10-14T19:20:00; 23.6 +2018-10-14T19:30:00; 23.4 +2018-10-14T19:40:00; 23.2 +2018-10-14T19:50:00; 23.2 +2018-10-14T20:00:00; 23.1 +2018-10-14T20:10:00; 23.0 +2018-10-14T20:20:00; 23.4 +2018-10-14T20:30:00; 24.0 +2018-10-14T20:40:00; 24.5 +2018-10-14T20:50:00; 24.8 +2018-10-14T21:00:00; 25.1 +2018-10-14T21:10:00; 25.4 +2018-10-14T21:20:00; 25.6 +2018-10-14T21:30:00; 25.6 +2018-10-14T21:40:00; 25.8 +2018-10-14T21:50:00; 25.9 +2018-10-14T22:00:00; 25.9 +2018-10-14T22:10:00; 26.0 +2018-10-14T22:20:00; 26.0 +2018-10-14T22:30:00; 26.0 +2018-10-14T22:40:00; 26.0 +2018-10-14T22:50:00; 26.0 +2018-10-14T23:00:00; 26.0 +2018-10-14T23:10:00; 26.0 +2018-10-14T23:20:00; 26.0 +2018-10-14T23:30:00; 26.0 +2018-10-14T23:40:00; 25.8 +2018-10-14T23:50:00; 25.6 +2018-10-15T00:00:00; 25.4 +2018-10-15T00:10:00; 25.2 +2018-10-15T00:20:00; 25.0 +2018-10-15T00:30:00; 24.9 +2018-10-15T00:40:00; 24.8 +2018-10-15T00:50:00; 24.6 +2018-10-15T01:00:00; 24.5 +2018-10-15T01:10:00; 24.4 +2018-10-15T01:20:00; 24.4 +2018-10-15T01:30:00; 24.3 +2018-10-15T01:40:00; 24.2 +2018-10-15T01:50:00; 24.2 +2018-10-15T02:00:00; 24.1 +2018-10-15T02:10:00; 24.0 +2018-10-15T02:20:00; 24.0 +2018-10-15T02:30:00; 23.9 +2018-10-15T02:40:00; 23.8 +2018-10-15T02:50:00; 23.8 +2018-10-15T03:00:00; 23.7 +2018-10-15T03:10:00; 23.7 +2018-10-15T03:20:00; 23.6 +2018-10-15T03:30:00; 23.6 +2018-10-15T03:40:00; 23.5 +2018-10-15T03:50:00; 23.5 +2018-10-15T04:00:00; 23.4 +2018-10-15T04:10:00; 23.4 +2018-10-15T04:20:00; 23.4 +2018-10-15T04:30:00; 23.3 +2018-10-15T04:40:00; 23.2 +2018-10-15T04:50:00; 23.2 +2018-10-15T05:00:00; 23.2 +2018-10-15T05:10:00; 23.1 +2018-10-15T05:20:00; 23.2 +2018-10-15T05:30:00; 23.1 +2018-10-15T05:39:00; 23.1 +2018-10-15T05:40:00; 23.1 +2018-10-15T05:50:00; 23.1 +2018-10-15T06:00:00; 23.1 +2018-10-15T06:10:00; 23.1 +2018-10-15T06:20:00; 23.0 +2018-10-15T06:30:00; 23.0 +2018-10-15T06:40:00; 23.0 +2018-10-15T06:50:00; 23.0 +2018-10-15T07:00:00; 23.0 +2018-10-15T07:10:00; 23.0 +2018-10-15T07:20:00; 23.0 +2018-10-15T07:30:00; 22.9 +2018-10-15T07:40:00; 22.9 +2018-10-15T07:50:00; 22.9 +2018-10-15T08:00:00; 22.9 +2018-10-15T08:10:00; 22.8 +2018-10-15T08:20:00; 22.8 +2018-10-15T08:30:00; 22.8 +2018-10-15T08:40:00; 22.8 +2018-10-15T08:50:00; 22.8 +2018-10-15T09:00:00; 22.8 +2018-10-15T09:10:00; 22.8 +2018-10-15T09:20:00; 22.8 +2018-10-15T09:30:00; 22.8 +2018-10-15T09:40:00; 22.8 +2018-10-15T09:50:00; 22.8 +2018-10-15T10:00:00; 22.6 +2018-10-15T10:10:00; 22.3 +2018-10-15T10:20:00; 22.1 +2018-10-15T10:30:00; 21.9 +2018-10-15T10:40:00; 21.8 +2018-10-15T10:50:00; 22.0 +2018-10-15T11:00:00; 22.4 +2018-10-15T11:10:00; 22.6 +2018-10-15T11:20:00; 23.0 +2018-10-15T11:30:00; 23.4 +2018-10-15T11:40:00; 23.8 +2018-10-15T11:50:00; 24.2 +2018-10-15T12:00:00; 24.4 +2018-10-15T12:10:00; 24.8 +2018-10-15T12:20:00; 25.0 +2018-10-15T12:30:00; 25.2 +2018-10-15T12:40:00; 25.3 +2018-10-15T12:50:00; 25.4 +2018-10-15T13:00:00; 25.5 +2018-10-15T13:10:00; 25.7 +2018-10-15T13:20:00; 26.0 +2018-10-15T13:30:00; 26.4 +2018-10-15T13:40:00; 26.6 +2018-10-15T13:50:00; 26.9 +2018-10-15T14:00:00; 27.1 +2018-10-15T14:10:00; 27.3 +2018-10-15T14:20:00; 27.3 +2018-10-15T14:30:00; 27.5 +2018-10-15T14:40:00; 27.6 +2018-10-15T14:50:00; 27.7 +2018-10-15T15:00:00; 27.8 +2018-10-15T15:10:00; 27.9 +2018-10-15T15:20:00; 28.0 +2018-10-15T15:30:00; 28.0 +2018-10-15T15:40:00; 28.0 +2018-10-15T15:50:00; 28.1 +2018-10-15T16:00:00; 28.2 +2018-10-15T16:10:00; 28.0 +2018-10-15T16:20:00; 28.0 +2018-10-15T16:30:00; 27.8 +2018-10-15T16:40:00; 27.6 +2018-10-15T16:50:00; 27.4 +2018-10-15T17:00:00; 27.2 +2018-10-15T17:10:00; 27.0 +2018-10-15T17:20:00; 26.8 +2018-10-15T17:30:00; 26.7 +2018-10-15T17:40:00; 26.6 +2018-10-15T17:50:00; 26.4 +2018-10-15T18:00:00; 26.3 +2018-10-15T18:10:00; 26.2 +2018-10-15T18:20:00; 26.1 +2018-10-15T18:30:00; 26.0 +2018-10-15T18:40:00; 25.9 +2018-10-15T18:50:00; 25.8 +2018-10-15T19:00:00; 25.7 +2018-10-15T19:10:00; 25.6 +2018-10-15T19:20:00; 25.5 +2018-10-15T19:30:00; 25.4 +2018-10-15T19:40:00; 25.4 +2018-10-15T19:50:00; 25.3 +2018-10-15T20:00:00; 25.2 +2018-10-15T20:10:00; 25.0 +2018-10-15T20:20:00; 24.9 +2018-10-15T20:30:00; 24.8 +2018-10-15T20:40:00; 24.7 +2018-10-15T20:50:00; 24.6 +2018-10-15T21:00:00; 24.5 +2018-10-15T21:10:00; 24.4 +2018-10-15T21:20:00; 24.4 +2018-10-15T21:30:00; 24.3 +2018-10-15T21:40:00; 24.3 +2018-10-15T21:50:00; 24.2 +2018-10-15T22:00:00; 24.2 +2018-10-15T22:10:00; 24.1 +2018-10-15T22:20:00; 24.1 +2018-10-15T22:30:00; 24.0 +2018-10-15T22:40:00; 24.0 +2018-10-15T22:50:00; 24.0 +2018-10-15T23:00:00; 23.9 +2018-10-15T23:10:00; 23.9 +2018-10-15T23:20:00; 23.8 +2018-10-15T23:30:00; 23.8 +2018-10-15T23:40:00; 23.8 +2018-10-15T23:50:00; 23.7 diff --git a/test/jkqtplotter_simpletest_dateaxes/weatherdata_heidelberg_2018-10-14.csv b/test/jkqtplotter_simpletest_dateaxes/weatherdata_heidelberg_2018-10-14.csv new file mode 100644 index 0000000000..c5b32aafa6 --- /dev/null +++ b/test/jkqtplotter_simpletest_dateaxes/weatherdata_heidelberg_2018-10-14.csv @@ -0,0 +1,145 @@ +Time; Temperature [degC] +00:00:00; 24.2 +00:10:00; 24.2 +00:20:00; 24.1 +00:30:00; 24.1 +00:40:00; 24.1 +00:50:00; 24.0 +01:00:00; 24.0 +01:10:00; 24.0 +01:20:00; 24.0 +01:30:00; 24.0 +01:40:00; 23.9 +01:50:00; 23.9 +02:00:00; 23.8 +02:10:00; 23.8 +02:20:00; 23.8 +02:30:00; 23.8 +02:40:00; 23.8 +02:50:00; 23.7 +03:00:00; 23.7 +03:10:00; 23.7 +03:20:00; 23.6 +03:30:00; 23.6 +03:40:00; 23.6 +03:50:00; 23.6 +04:00:00; 23.6 +04:10:00; 23.6 +04:20:00; 23.6 +04:30:00; 23.6 +04:40:00; 23.6 +04:50:00; 23.5 +05:00:00; 23.5 +05:10:00; 23.5 +05:20:00; 23.4 +05:30:00; 23.4 +05:40:00; 23.4 +05:50:00; 23.4 +06:00:00; 23.4 +06:10:00; 23.4 +06:20:00; 23.4 +06:30:00; 23.4 +06:40:00; 23.4 +06:50:00; 23.4 +07:00:00; 23.4 +07:10:00; 23.4 +07:20:00; 23.4 +07:30:00; 23.4 +07:40:00; 23.4 +07:50:00; 23.4 +08:00:00; 23.4 +08:10:00; 23.3 +08:20:00; 23.3 +08:30:00; 23.2 +08:40:00; 23.2 +08:50:00; 23.2 +09:00:00; 23.1 +09:10:00; 23.1 +09:20:00; 23.0 +09:30:00; 23.0 +09:40:00; 23.0 +09:50:00; 23.1 +10:00:00; 23.1 +10:10:00; 23.2 +10:20:00; 23.2 +10:30:00; 23.3 +10:40:00; 23.4 +10:50:00; 23.5 +11:00:00; 23.6 +11:10:00; 23.8 +11:20:00; 24.0 +11:30:00; 24.3 +11:40:00; 24.6 +11:50:00; 24.9 +12:00:00; 25.3 +12:10:00; 25.6 +12:20:00; 25.8 +12:30:00; 25.8 +12:40:00; 25.8 +12:50:00; 25.8 +13:00:00; 25.8 +13:10:00; 25.9 +13:20:00; 26.1 +13:30:00; 26.3 +13:40:00; 26.5 +13:50:00; 26.6 +14:00:00; 26.8 +14:10:00; 26.9 +14:20:00; 27.0 +14:30:00; 27.2 +14:40:00; 27.2 +14:50:00; 27.4 +15:00:00; 27.4 +15:10:00; 27.4 +15:20:00; 27.4 +15:30:00; 27.5 +15:40:00; 27.5 +15:50:00; 27.5 +16:00:00; 27.5 +16:10:00; 27.4 +16:20:00; 27.3 +16:30:00; 27.0 +16:40:00; 26.8 +16:50:00; 26.0 +17:00:00; 25.5 +17:10:00; 25.3 +17:20:00; 25.1 +17:30:00; 24.9 +17:40:00; 24.7 +17:50:00; 24.5 +18:00:00; 24.3 +18:10:00; 24.2 +18:20:00; 24.1 +18:30:00; 24.0 +18:40:00; 23.8 +18:50:00; 23.8 +19:00:00; 23.7 +19:10:00; 23.6 +19:20:00; 23.6 +19:30:00; 23.4 +19:40:00; 23.2 +19:50:00; 23.2 +20:00:00; 23.1 +20:10:00; 23.0 +20:20:00; 23.4 +20:30:00; 24.0 +20:40:00; 24.5 +20:50:00; 24.8 +21:00:00; 25.1 +21:10:00; 25.4 +21:20:00; 25.6 +21:30:00; 25.6 +21:40:00; 25.8 +21:50:00; 25.9 +22:00:00; 25.9 +22:10:00; 26.0 +22:20:00; 26.0 +22:30:00; 26.0 +22:40:00; 26.0 +22:50:00; 26.0 +23:00:00; 26.0 +23:10:00; 26.0 +23:20:00; 26.0 +23:30:00; 26.0 +23:40:00; 25.8 +23:50:00; 25.6