From a67975e68055574afdd2db5ceb36aabcb5af1ed4 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Mon, 22 Apr 2019 13:27:50 +0200 Subject: [PATCH] - major rework of graph styling (now using mix-in classes) - some reorganizations into different files - additional options for graph filling (color gradients, textures, ...) as provided by QBrush - PREPARATIONS: added a general feature to JKQTPPlotElement which allows to show a graph in a highlighted state (if supported by the derived graph class!) - JKQTPXYParametrizedScatterGraph: added functors to transform column values into symbol type+size and line-width to give even more control - JKQTPStepHorizontalGraph has been renamed to JKQTPSpecialLineHorizontalGraph (vertical variants also) and have gained additional features (baseline for filling and drawing of symbols) - filled curve graphs (e.g. JKQTPSpecialLineHorizontalGraph) are now merely a specializedly initialized JKQTPSpecialLineHorizontalGraph --- doc/dox/examples_and_tutorials.dox | 4 +- doc/dox/jkqtplotter.dox | 8 +- doc/dox/whatsnew.dox | 19 +- doc/images/JKQTPDirectLine.png | Bin 0 -> 6428 bytes doc/images/JKQTPStepAverage.png | Bin 0 -> 4501 bytes doc/images/JKQTPStepCenter.png | Bin 4516 -> 5216 bytes doc/images/JKQTPStepLeft.png | Bin 4654 -> 4810 bytes doc/images/JKQTPStepRight.png | Bin 4549 -> 4831 bytes ...ametrizedScatterGraph_LinewidthFunctor.png | Bin 0 -> 44890 bytes ...trizedScatterGraph_MappedSymbolFunctor.cpt | Bin 0 -> 564527 bytes ...trizedScatterGraph_MappedSymbolFunctor.png | Bin 0 -> 49374 bytes ...ParametrizedScatterGraph_SymbolFunctor.png | Bin 0 -> 50805 bytes examples/README.md | 2 +- .../jkqtplot_test/TestWidgetFunctionPlots.cpp | 2 +- examples/jkqtplot_test/TestWidgetGraphs.cpp | 14 +- examples/jkqtplot_test/TestWidgetImages.cpp | 2 +- .../jkqtplot_test/TestWidgetPeaksPlots.cpp | 12 +- .../simpletest/jkqtplotter_simpletest.cpp | 2 +- .../jkqtplotter_simpletest_barchart.cpp | 2 +- examples/simpletest_boxplot/README.md | 2 +- .../jkqtplotter_simpletest_boxplot.cpp | 6 +- examples/simpletest_dateaxes/README.md | 2 +- .../jkqtplotter_simpletest_dateaxes.cpp | 8 +- examples/simpletest_errorbarstyles/README.md | 6 +- .../jkqtplotter_simpletest_errorbarstyles.cpp | 8 +- examples/simpletest_functionplot/README.md | 10 +- .../jkqtplotter_simpletest_functionplot.cpp | 10 +- ...kqtplotter_simpletest_imageplot_opencv.cpp | 2 +- examples/simpletest_impulsesplot/README.md | 20 + .../jkqtplotter_simpletest_impulsesplot.cpp | 3 + examples/simpletest_logaxes/README.md | 8 +- .../jkqtplotter_simpletest_logaxes.cpp | 8 +- examples/simpletest_parametriccurve/README.md | 4 +- ...jkqtplotter_simpletest_parametriccurve.cpp | 6 +- .../simpletest_paramscatterplot/README.md | 57 +- ...kqtplotter_simpletest_paramscatterplot.cpp | 29 +- .../README.md | 2 +- ...tter_simpletest_paramscatterplot_image.cpp | 4 +- ...tplotter_simpletest_parsedfunctionplot.cpp | 2 +- ...plotter_simpletest_rgbimageplot_opencv.cpp | 2 +- ...jkqtplotter_simpletest_rgbimageplot_qt.cpp | 2 +- .../jkqtplotter_simpletest_speed.cpp | 2 +- examples/simpletest_speed/speedtestplot.cpp | 2 +- .../jkqtplotter_simpletest_stackedbars.cpp | 2 +- examples/simpletest_stepplots/README.md | 41 +- .../jkqtplotter_simpletest_stepplots.cpp | 153 +- .../jkqtplotter_simpletest_stepplots.pro | 3 +- ...tplotter_simpletest_stepplots_vertical.cpp | 180 ++ .../simpletest_symbols_and_errors/README.md | 2 +- ...tplotter_simpletest_symbols_and_errors.cpp | 4 +- .../simpletest_symbols_and_styles/README.md | 12 +- ...tplotter_simpletest_symbols_and_styles.cpp | 12 +- examples/test_distributionplot/README.md | 4 +- .../test_distributionplot.cpp | 7 +- examples/test_multiplot/test_multiplot.cpp | 6 +- examples/test_styling/test_styling.cpp | 4 +- .../test_user_interaction.h | 2 +- lib/jkqtplotter.pri | 10 +- lib/jkqtplotter/jkqtpbaseplotter.cpp | 91 +- lib/jkqtplotter/jkqtpbaseplotter.h | 5 +- lib/jkqtplotter/jkqtpelementsoverlay.cpp | 205 ++- lib/jkqtplotter/jkqtpelementsoverlay.h | 303 +--- lib/jkqtplotter/jkqtpgraphs.cpp | 1571 ----------------- lib/jkqtplotter/jkqtpgraphs.h | 1067 ----------- lib/jkqtplotter/jkqtpgraphsbarchart.cpp | 113 +- lib/jkqtplotter/jkqtpgraphsbarchart.h | 127 +- lib/jkqtplotter/jkqtpgraphsbase.cpp | 157 +- lib/jkqtplotter/jkqtpgraphsbase.h | 102 +- lib/jkqtplotter/jkqtpgraphsbaseerrors.cpp | 60 + lib/jkqtplotter/jkqtpgraphsbaseerrors.h | 60 +- .../jkqtpgraphsbasestylingmixins.cpp | 446 +++++ .../jkqtpgraphsbasestylingmixins.h | 381 ++++ lib/jkqtplotter/jkqtpgraphsboxplot.cpp | 4 +- lib/jkqtplotter/jkqtpgraphsboxplot.h | 10 +- lib/jkqtplotter/jkqtpgraphscontour.cpp | 151 +- lib/jkqtplotter/jkqtpgraphscontour.h | 105 +- .../jkqtpgraphsevaluatedfunction.cpp | 284 +-- .../jkqtpgraphsevaluatedfunction.h | 239 +-- lib/jkqtplotter/jkqtpgraphsfilledcurve.cpp | 422 +---- lib/jkqtplotter/jkqtpgraphsfilledcurve.h | 274 +-- lib/jkqtplotter/jkqtpgraphsgeometric.cpp | 559 ++++-- lib/jkqtplotter/jkqtpgraphsgeometric.h | 701 +++----- lib/jkqtplotter/jkqtpgraphsimage.cpp | 385 +++- lib/jkqtplotter/jkqtpgraphsimage.h | 370 +--- lib/jkqtplotter/jkqtpgraphsimageoverlays.cpp | 148 +- lib/jkqtplotter/jkqtpgraphsimageoverlays.h | 150 +- lib/jkqtplotter/jkqtpgraphsimagergb.cpp | 412 ++++- lib/jkqtplotter/jkqtpgraphsimagergb.h | 607 +++---- lib/jkqtplotter/jkqtpgraphsimpulses.cpp | 110 +- lib/jkqtplotter/jkqtpgraphsimpulses.h | 70 +- lib/jkqtplotter/jkqtpgraphsparsedfunction.cpp | 96 +- lib/jkqtplotter/jkqtpgraphsparsedfunction.h | 64 +- lib/jkqtplotter/jkqtpgraphspeakstream.cpp | 93 +- lib/jkqtplotter/jkqtpgraphspeakstream.h | 68 +- lib/jkqtplotter/jkqtpgraphsrange.cpp | 466 +++++ lib/jkqtplotter/jkqtpgraphsrange.h | 242 +++ lib/jkqtplotter/jkqtpgraphsscatter.cpp | 1010 +++++++++++ lib/jkqtplotter/jkqtpgraphsscatter.h | 472 +++++ .../jkqtpgraphssinglecolumnsymbols.cpp | 106 +- .../jkqtpgraphssinglecolumnsymbols.h | 132 +- lib/jkqtplotter/jkqtpgraphsspecialline.cpp | 501 ++++++ lib/jkqtplotter/jkqtpgraphsspecialline.h | 128 ++ lib/jkqtplotter/jkqtplotter.cpp | 2 +- lib/jkqtplottergui/jkqtpcomboboxes.cpp | 32 +- lib/jkqtplottergui/jkqtpcomboboxes.h | 20 +- lib/jkqtplottergui/jkqtpgraphsmodel.cpp | 2 +- lib/jkqtplottertools/jkqtptools.cpp | 8 +- lib/jkqtplottertools/jkqtptools.h | 23 +- ...otter_simpletest_impulsesplot_baseline.png | Bin 0 -> 17218 bytes ...lotter_simpletest_impulsesplot_symbols.png | Bin 0 -> 23611 bytes .../jkqtplotter_simpletest_stepplots.png | Bin 31401 -> 34799 bytes ...jkqtplotter_simpletest_stepplots_small.png | Bin 10153 -> 11035 bytes ...tplotter_simpletest_stepplots_vertical.png | Bin 0 -> 38500 bytes 113 files changed, 7362 insertions(+), 6506 deletions(-) create mode 100644 doc/images/JKQTPDirectLine.png create mode 100644 doc/images/JKQTPStepAverage.png create mode 100644 doc/images/JKQTPXYParametrizedScatterGraph_LinewidthFunctor.png create mode 100644 doc/images/JKQTPXYParametrizedScatterGraph_MappedSymbolFunctor.cpt create mode 100644 doc/images/JKQTPXYParametrizedScatterGraph_MappedSymbolFunctor.png create mode 100644 doc/images/JKQTPXYParametrizedScatterGraph_SymbolFunctor.png create mode 100644 examples/simpletest_stepplots/jkqtplotter_simpletest_stepplots_vertical.cpp delete mode 100644 lib/jkqtplotter/jkqtpgraphs.cpp delete mode 100644 lib/jkqtplotter/jkqtpgraphs.h create mode 100644 lib/jkqtplotter/jkqtpgraphsbasestylingmixins.cpp create mode 100644 lib/jkqtplotter/jkqtpgraphsbasestylingmixins.h create mode 100644 lib/jkqtplotter/jkqtpgraphsrange.cpp create mode 100644 lib/jkqtplotter/jkqtpgraphsrange.h create mode 100644 lib/jkqtplotter/jkqtpgraphsscatter.cpp create mode 100644 lib/jkqtplotter/jkqtpgraphsscatter.h create mode 100644 lib/jkqtplotter/jkqtpgraphsspecialline.cpp create mode 100644 lib/jkqtplotter/jkqtpgraphsspecialline.h create mode 100644 screenshots/jkqtplotter_simpletest_impulsesplot_baseline.png create mode 100644 screenshots/jkqtplotter_simpletest_impulsesplot_symbols.png create mode 100644 screenshots/jkqtplotter_simpletest_stepplots_vertical.png diff --git a/doc/dox/examples_and_tutorials.dox b/doc/dox/examples_and_tutorials.dox index e5e2e59d65..56785145f4 100644 --- a/doc/dox/examples_and_tutorials.dox +++ b/doc/dox/examples_and_tutorials.dox @@ -21,8 +21,8 @@ All test-projects are Qt-projects that use qmake to build. You can load them int \subpage JKQTPlotterSymbolsAndStyles `JKQTPXYLineGraph`
C++ vector of data
setting line styles and symbol styles
automatic graph coloring \image html jkqtplotter_simpletest_stepplots_small.png - \subpage JKQTPlotterStepPlot - `JKQTPStepHorizontalGraph` (and `JKQTPXYLineGraph`)
C++ vector of data
different step modes, filled and line-only + \subpage JKQTPlotterSpecialStepLinePlot + `JKQTPSpecialLineHorizontalGraph`
C++ vector of data
different step/special line modes, filled and line-only \image html jkqtplotter_simpletest_symbols_and_errors_small.png \subpage JKQTPlotterSymbolsErrors `JKQTPXYLineErrorGraph`
C-style arrays of data diff --git a/doc/dox/jkqtplotter.dox b/doc/dox/jkqtplotter.dox index 3a6fea2425..fc099f97ea 100644 --- a/doc/dox/jkqtplotter.dox +++ b/doc/dox/jkqtplotter.dox @@ -115,7 +115,6 @@ derive from JKQTPPlotElement, but from a cass in it's hirarchy of children. Thes \subsection jkqtplotter_graphsgroup_classstructure_mixins Mix-In Classes for Graphs - In addition there are mix-in classes that are used via multiple inheritance that add additional features and properties to a graph. A prominent example are the classes for \ref jkqtplotter_basegraphserrors "error indicators". With these there are usually two variants of one type of graph: One without error indicators and one with error indicators, e.g.: @@ -136,6 +135,9 @@ mainly used for the \ref jkqtplotter_imagelots "Image/Matrix graphs", but also b \defgroup jkqtplotter_basegraphserrors Mix-In Classes for Error Indicators \ingroup jkqtplotter_basegraphs +\defgroup jkqtplotter_basegraphs_stylemixins Mix-In Classes for Plot Styling +\ingroup jkqtplotter_basegraphs + \defgroup jkqtplotter_linesymbolgraphs Line/Symbol Graphs \ingroup jkqtplotter_graphsgroup @@ -155,7 +157,7 @@ This group assembles graphs that show their data with symbols and optionally wit JKQTPXYParametrizedScatterGraph, JKQTPXYParametrizedErrorScatterGraph \image html jkqtplotter_simpletest_stepplots_small.png - JKQTPStepHorizontalGraph, JKQTPStepVerticalGraph + JKQTPSpecialLineHorizontalGraph, JKQTPSpecialLineVerticalGraph \defgroup jkqtplotter_linesymbolgraphs_simple Basic Line/Scatter Graphs @@ -173,7 +175,7 @@ This group assembles graphs that show their data with symbols and optionally wit JKQTPXYLineGraph, JKQTPXYLineErrorGraph \image html jkqtplotter_simpletest_stepplots_small.png - JKQTPStepHorizontalGraph, JKQTPStepVerticalGraph + JKQTPSpecialLineHorizontalGraph, JKQTPSpecialLineVerticalGraph diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox index 5834c6c14a..b031fb504c 100644 --- a/doc/dox/whatsnew.dox +++ b/doc/dox/whatsnew.dox @@ -16,28 +16,35 @@ Starting in summer 2018, JKQTPlotter received some major workover. During this, Changes, compared to \ref WHATSNEW_V2018_08 "v2018.08" include: