From 972bc6c1e05d71ab0b78b57e37bf30f87ff97695 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Fri, 28 Oct 2022 21:48:42 +0200 Subject: [PATCH] NEW: you can provide a custom draw functor to barcharts to completely customize their look --- doc/CMakeLists.txt | 2 + doc/dox/examples_and_tutorials.dox | 5 +- doc/dox/todo.dox | 2 +- doc/dox/whatsnew.dox | 1 + ...QTPBarHorizontalGraphCustomDrawFunctor.png | Bin 0 -> 13624 bytes ...HorizontalGraphCustomDrawFunctor_small.png | Bin 0 -> 5475 bytes ...JKQTPBarVerticalGraphCustomDrawFunctor.png | Bin 0 -> 13455 bytes ...arVerticalGraphCustomDrawFunctor_small.png | Bin 0 -> 5438 bytes examples/CMakeLists.txt | 1 + .../barchart_customdrawfunctor/CMakeLists.txt | 34 ++++++ examples/barchart_customdrawfunctor/README.md | 89 +++++++++++++++ .../barchart_customdrawfunctor.cpp | 102 ++++++++++++++++++ examples/barchart_functorfill/README.md | 2 +- lib/jkqtplotter/graphs/jkqtpbarchart.cpp | 54 ++++++---- lib/jkqtplotter/graphs/jkqtpbarchart.h | 38 +++++++ lib/jkqtplotter/graphs/jkqtpbarchartbase.cpp | 22 +++- lib/jkqtplotter/graphs/jkqtpbarchartbase.h | 63 +++++++++++ screenshots/barchart_customdrawfunctor.png | Bin 0 -> 19671 bytes .../barchart_customdrawfunctor_hor.png | Bin 0 -> 19762 bytes .../barchart_customdrawfunctor_hor_small.png | Bin 0 -> 5475 bytes .../barchart_customdrawfunctor_small.png | Bin 0 -> 5438 bytes screenshots/multiplot_controlwindow.png | Bin 37707 -> 37738 bytes screenshots/multiplot_controlwindow_small.png | Bin 6027 -> 6053 bytes screenshots/parsedfunctionplot.png | Bin 29293 -> 29281 bytes screenshots/parsedfunctionplot_small.png | Bin 8340 -> 8315 bytes 25 files changed, 390 insertions(+), 25 deletions(-) create mode 100644 doc/images/JKQTPBarHorizontalGraphCustomDrawFunctor.png create mode 100644 doc/images/JKQTPBarHorizontalGraphCustomDrawFunctor_small.png create mode 100644 doc/images/JKQTPBarVerticalGraphCustomDrawFunctor.png create mode 100644 doc/images/JKQTPBarVerticalGraphCustomDrawFunctor_small.png create mode 100644 examples/barchart_customdrawfunctor/CMakeLists.txt create mode 100644 examples/barchart_customdrawfunctor/README.md create mode 100644 examples/barchart_customdrawfunctor/barchart_customdrawfunctor.cpp create mode 100644 screenshots/barchart_customdrawfunctor.png create mode 100644 screenshots/barchart_customdrawfunctor_hor.png create mode 100644 screenshots/barchart_customdrawfunctor_hor_small.png create mode 100644 screenshots/barchart_customdrawfunctor_small.png diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 9bba364c33..cfc0cd59d0 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -144,6 +144,7 @@ if(JKQtPlotter_BUILD_EXAMPLES) barchart_twocolor/barchart_twocolor,barchart_twocolor_hor barchart_errorbars/barchart_errorbars,barchart_errorbars_hor barchart_functorfill/barchart_functorfill,barchart_functorfill_hor + barchart_customdrawfunctor/barchart_customdrawfunctor,barchart_customdrawfunctor_hor wiggleplots/wiggleplot_x,wiggleplot_y advplotstyling/advancedlineandfillstyling boxplot @@ -196,6 +197,7 @@ if(JKQtPlotter_BUILD_EXAMPLES) barchart_twocolor/JKQTPBarVerticalGraphTwoColorFilling,JKQTPBarHorizontalGraphTwoColorFilling/--smallscreenshotplot barchart_errorbars/JKQTPBarVerticalErrorGraph,JKQTPBarHorizontalErrorGraph/--smallscreenshotplot barchart_functorfill/JKQTPBarVerticalGraphFunctorFilling,JKQTPBarHorizontalGraphFunctorFilling/--smallscreenshotplot + barchart_customdrawfunctor/JKQTPBarVerticalGraphCustomDrawFunctor,JKQTPBarHorizontalGraphCustomDrawFunctor/--smallscreenshotplot wiggleplots/JKQTPFilledCurveXGraph_wiggle,JKQTPFilledCurveYGraph_wiggle contourplot/JKQTPColumnContourPlot/--smallscreenshotplot filledgraphs/JKQTPFilledCurveXGraph,JKQTPFilledCurveYGraph/--smallscreenshotplot diff --git a/doc/dox/examples_and_tutorials.dox b/doc/dox/examples_and_tutorials.dox index f1a5ffd337..7d313c07f4 100644 --- a/doc/dox/examples_and_tutorials.dox +++ b/doc/dox/examples_and_tutorials.dox @@ -46,9 +46,12 @@ All test-projects are Qt-projects that use qmake to build. You can load them int \image html barchart_twocolor_small.png \subpage JKQTPlotterBarchartsTwoColorFilling `JKQTPBarVerticalGraph`
JKQTPDatastore::addColumnCalculatedFromColumn() - \image html barchart_functorfill_small.png + \image html barchart_customdrawfunctor_small.png \subpage JKQTPlotterBarchartsFunctorFilling `JKQTPBarVerticalGraph`
JKQTPDatastore::addColumnCalculatedFromColumn() + \image html barchart_functorfill_small.png + \subpage JKQTPlotterBarchartsCustomDrawFunctor + `JKQTPBarVerticalGraph`
JKQTPDatastore::addColumnCalculatedFromColumn() \image html stackedbars_small.png \subpage JKQTPlotterStackedBarChart `JKQTPBarVerticalStackableGraph`, `JKQTPBarHorizontalStackableGraph`
C++-style vectors of data diff --git a/doc/dox/todo.dox b/doc/dox/todo.dox index 2f5abfd547..cce4ad21fa 100644 --- a/doc/dox/todo.dox +++ b/doc/dox/todo.dox @@ -26,7 +26,7 @@ This page lists several todos and wishes for future version of JKQTPlotter
  • plot: elongated grid to left of tick labels
  • plot: legend positioning as combination of 3 values: inside|outside + left|center|right + top|vcenter|bottom
  • plot: refactor print preview/export preview code
  • -
  • plot: reqork layouting of legends: there are some inconsistencies/too large gaps ...
  • +
  • plot: rework layouting of legends: there are some inconsistencies/too large gaps ...
  • plot: secondary axes: independent and dependent (i.e. with transformation function from primary axis)
  • sryling: better styling/more styling options for data-tooltips
  • styling: color gradients as fill-styles in style-INIs
  • diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox index 9fc8ce491f..1f221b70a6 100644 --- a/doc/dox/whatsnew.dox +++ b/doc/dox/whatsnew.dox @@ -64,6 +64,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
  • NEW: barcharts (derived from JKQTPBarGraphBase) can be configured to use different fill styles above and below the baseline, see JKQTPBarGraphBase::FillMode
  • NEW: barcharts may have rounded corners now, via JKQTPBarGraphBase::setRectRadius()
  • NEW: barcharts can be colored by a user-specified functor
  • +
  • NEW: you can provide a custom draw functor to barcharts to completely customize their look
  • JKQTMathText: