From 40748de44212bedc3de66427b7b3f04f1ca0df06 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Sat, 10 Sep 2022 14:35:16 +0200 Subject: [PATCH] JKQTPlotter: NEW: barcharts (derived from JKQTPBarGraphBase) can be configured to use different fill styles above and below the baseline --- doc/CMakeLists.txt | 2 + doc/dox/examples_and_tutorials.dox | 3 + doc/dox/todo.dox | 1 - doc/dox/whatsnew.dox | 1 + ...JKQTPBarHorizontalGraphTwoColorFilling.png | Bin 0 -> 13531 bytes ...arHorizontalGraphTwoColorFilling_small.png | Bin 0 -> 9732 bytes .../JKQTPBarVerticalGraphTwoColorFilling.png | Bin 0 -> 13910 bytes ...PBarVerticalGraphTwoColorFilling_small.png | Bin 0 -> 9668 bytes examples/CMakeLists.txt | 1 + examples/barchart_twocolor/CMakeLists.txt | 34 ++++++++++ examples/barchart_twocolor/README.md | 44 +++++++++++++ .../barchart_twocolor/barchart_twocolor.cpp | 58 ++++++++++++++++++ lib/jkqtplotter/graphs/jkqtpbarchart.cpp | 16 +++-- lib/jkqtplotter/graphs/jkqtpbarchart.h | 9 +++ lib/jkqtplotter/graphs/jkqtpbarchartbase.cpp | 24 +++++++- lib/jkqtplotter/graphs/jkqtpbarchartbase.h | 25 ++++++++ screenshots/barchart_twocolor.png | Bin 0 -> 22468 bytes screenshots/barchart_twocolor_hor.png | Bin 0 -> 21754 bytes screenshots/barchart_twocolor_hor_small.png | Bin 0 -> 9732 bytes screenshots/barchart_twocolor_small.png | Bin 0 -> 9668 bytes 20 files changed, 211 insertions(+), 7 deletions(-) create mode 100644 doc/images/JKQTPBarHorizontalGraphTwoColorFilling.png create mode 100644 doc/images/JKQTPBarHorizontalGraphTwoColorFilling_small.png create mode 100644 doc/images/JKQTPBarVerticalGraphTwoColorFilling.png create mode 100644 doc/images/JKQTPBarVerticalGraphTwoColorFilling_small.png create mode 100644 examples/barchart_twocolor/CMakeLists.txt create mode 100644 examples/barchart_twocolor/README.md create mode 100644 examples/barchart_twocolor/barchart_twocolor.cpp create mode 100644 screenshots/barchart_twocolor.png create mode 100644 screenshots/barchart_twocolor_hor.png create mode 100644 screenshots/barchart_twocolor_hor_small.png create mode 100644 screenshots/barchart_twocolor_small.png diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 1edd04e4bd..c2984058a1 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -125,6 +125,7 @@ if(JKQtPlotter_BUILD_EXAMPLES) scatter_customsymbol simpletest barchart/barchart,barchart_hor + barchart_twocolor/barchart_twocolor,barchart_twocolor_hor wiggleplots/wiggleplot_x,wiggleplot_y advplotstyling/advancedlineandfillstyling boxplot @@ -172,6 +173,7 @@ if(JKQtPlotter_BUILD_EXAMPLES) scatter/JKQTPXYScatterGraph,JKQTPXYScatterErrorGraph/--smallscreenshotplot simpletest/JKQTPXYLineGraph/--smallscreenshotplot barchart/JKQTPBarVerticalGraph,JKQTPBarHorizontalGraph/--smallscreenshotplot + barchart_twocolor/JKQTPBarVerticalGraphTwoColorFilling,JKQTPBarHorizontalGraphTwoColorFilling/--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 35b576738e..8f860e4c07 100644 --- a/doc/dox/examples_and_tutorials.dox +++ b/doc/dox/examples_and_tutorials.dox @@ -40,6 +40,9 @@ All test-projects are Qt-projects that use qmake to build. You can load them int \image html barchart_small.png \subpage JKQTPlotterBarcharts `JKQTPBarVerticalGraph`
C-style arrays of data + \image html barchart_twocolor_small.png + \subpage JKQTPlotterBarchartsTwoColorFilling + `JKQTPBarVerticalGraph`
\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 418b591071..589e3edb6e 100644 --- a/doc/dox/todo.dox +++ b/doc/dox/todo.dox @@ -15,7 +15,6 @@ This page lists several todos and wishes for future version of JKQTPlotter
  • styling: style.ini with glowing colors in dark background ("techno" or "cyberpunk")
  • plot: axis labels above/below/centered around tick
  • plot: elongated grid to left of tick labels
  • -
  • graphs: different styles above/below baseline for barcharts ...
  • graphs: vector field graph (arrows), variant (x,y,dx,dy), (x,y,alpha,length), (x1,y1,x2,y2) ... different head/tail styles
  • graphs: gant-chart as simplufier vector field with (x,y1,y2) or (x1,x2,y), or (x,y,dx), (x,y,dy) ... different head/tail style
  • graphs: barchart/ranges chart with (x,y1,y2) or (x1,x2,y)
  • diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox index 5942431a9d..7661e8505f 100644 --- a/doc/dox/whatsnew.dox +++ b/doc/dox/whatsnew.dox @@ -47,6 +47,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
  • NEW: added the option to register a custom symbol using JKQTPRegisterCustomGraphSymbol()
  • NEW: added property drawLineInForeground to JKQTPXYLineGraph and JKQTPXYParametrizedScatterGraph
  • NEW: added JKQTPXYGraph::setKeyColumn()/JKQTPXYGraph::getKeyColumn() and JKQTPXYGraph::setValueColumn()/JKQTPXYGraph::getValueColumn() and corresponding functions in other classes. In most graph classes they point to xColumn for key and yColumn for values. These functions are virtual and overwritten in derived classes with horizontally oriented graphs, where they point to yColumn for key and yColumn for value. This way you can write generic code with classes for both orientations.
  • +
  • NEW: barcharts (derived from JKQTPBarGraphBase) can be configured to use different fill styles above and below the baseline, see JKQTPBarGraphBase::FillMode
  • JKQTMathText: