diff --git a/doc/dox/jkqtplotter_styling.dox b/doc/dox/jkqtplotter_styling.dox
index 8406ecb5aee..90e95cb58eb 100644
--- a/doc/dox/jkqtplotter_styling.dox
+++ b/doc/dox/jkqtplotter_styling.dox
@@ -91,6 +91,10 @@ Here is a table with all available ready-made styles:
+ :/JKQTPlotter/styles/simple_noaxes.ini
+ | \image html simple_noaxes.ini.png
+ | \image html simple_noaxes.ini.symbols.png
diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox
index 764d890b971..4649ceb11b3 100644
--- a/doc/dox/whatsnew.dox
+++ b/doc/dox/whatsnew.dox
@@ -118,7 +118,8 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
NEW: Due to addition of JKQTMathText::setFontOptions() and the matchign extension of JKQTMathText::setFontSpecial() (see below) you can now add modifiers like +BOLD+ITALIC to any font-name provided to JKQTPlotter and in style INI-files
NEW: added JKQTPLabelMinBesides and JKQTPLabelMaxBesides to JKQTPLabelPosition, so labels can be set besides the axes
NEW/REWORKED all functions in JKQTBasePlotter are re-entrant, i.e. different instances can be used from different threads in parallel (although there is some overhead due to shared caches between the threads!). This is demonstrated and discussed in \ref JKQTPlotterMultiThreaded .
- NEW: NEW allow linear-gradient()... in brush definitions of style.ini-file
+ NEW: allow linear-gradient(), currentcolor, ... in brush definitions of style.ini-file ... and using it is cyberpunk and dark styles
+ NEW: style simple_noaxes.ini
JKQTMathText:
diff --git a/doc/images/jkqtmathtext/jkqtmathtext_utf8.png b/doc/images/jkqtmathtext/jkqtmathtext_utf8.png
index 59808b41c77..c9e4fd09bb9 100644
Binary files a/doc/images/jkqtmathtext/jkqtmathtext_utf8.png and b/doc/images/jkqtmathtext/jkqtmathtext_utf8.png differ
diff --git a/doc/images/styles/cyberpunk.ini.png b/doc/images/styles/cyberpunk.ini.png
index 4d6f9120697..b47a97de101 100644
Binary files a/doc/images/styles/cyberpunk.ini.png and b/doc/images/styles/cyberpunk.ini.png differ
diff --git a/doc/images/styles/cyberpunk.ini.symbols.png b/doc/images/styles/cyberpunk.ini.symbols.png
index 641b0af6934..7a1dbc996a0 100644
Binary files a/doc/images/styles/cyberpunk.ini.symbols.png and b/doc/images/styles/cyberpunk.ini.symbols.png differ
diff --git a/doc/images/styles/dark.ini.png b/doc/images/styles/dark.ini.png
index ef7b614985c..d0fe00f77e9 100644
Binary files a/doc/images/styles/dark.ini.png and b/doc/images/styles/dark.ini.png differ
diff --git a/doc/images/styles/dark.ini.symbols.png b/doc/images/styles/dark.ini.symbols.png
index 5dcb6ecefbc..42a02582d59 100644
Binary files a/doc/images/styles/dark.ini.symbols.png and b/doc/images/styles/dark.ini.symbols.png differ
diff --git a/doc/images/styles/default.ini.png b/doc/images/styles/default.ini.png
index 063994794b9..1cf05731bb7 100644
Binary files a/doc/images/styles/default.ini.png and b/doc/images/styles/default.ini.png differ
diff --git a/doc/images/styles/simple_noaxes.ini.png b/doc/images/styles/simple_noaxes.ini.png
new file mode 100644
index 00000000000..a97aa4a7ab1
Binary files /dev/null and b/doc/images/styles/simple_noaxes.ini.png differ
diff --git a/doc/images/styles/simple_noaxes.ini.symbols.png b/doc/images/styles/simple_noaxes.ini.symbols.png
new file mode 100644
index 00000000000..e55d50fc937
Binary files /dev/null and b/doc/images/styles/simple_noaxes.ini.symbols.png differ
diff --git a/lib/jkqtcommon/jkqtpdrawingtools.cpp b/lib/jkqtcommon/jkqtpdrawingtools.cpp
index b12ddf69fc3..eeaaef2e15a 100644
--- a/lib/jkqtcommon/jkqtpdrawingtools.cpp
+++ b/lib/jkqtcommon/jkqtpdrawingtools.cpp
@@ -21,6 +21,12 @@
#include
const double JKQTPlotterDrawingTools::ABS_MIN_LINEWIDTH= 0.02;
+const QColor JKQTPlotterDrawingTools::CurrentColorPlaceholder = QColor::fromRgbF(0.1234,0.5678,0.9123,1.0);
+const QColor JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10 = QColor::fromRgbF(0.1234,0.5678,0.9123,0.1);
+const QColor JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans25 = QColor::fromRgbF(0.1234,0.5678,0.9123,0.25);
+const QColor JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans50 = QColor::fromRgbF(0.1234,0.5678,0.9123,0.5);
+const QColor JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans75 = QColor::fromRgbF(0.1234,0.5678,0.9123,0.75);
+const QColor JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans90 = QColor::fromRgbF(0.1234,0.5678,0.9123,0.9);
@@ -567,3 +573,22 @@ JKQTPGraphSymbols JKQTPRegisterCustomGraphSymbol(const JKQTPCustomGraphSymbolFun
JKQTPlotterDrawingTools::JKQTPCustomGraphSymbolStore->push_back(f);
return static_cast(static_cast(JKQTPFirstCustomSymbol)+static_cast(JKQTPlotterDrawingTools::JKQTPCustomGraphSymbolStore->size()-1));
}
+
+void JKQTPReplaceCurrentColor(QColor &col, const QColor ¤tColor)
+{
+ if (col==JKQTPlotterDrawingTools::CurrentColorPlaceholder) col=currentColor;
+ else if (col==JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10) { col=currentColor; col.setAlphaF(0.9); }
+ else if (col==JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans25) { col=currentColor; col.setAlphaF(0.75); }
+ else if (col==JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans50) { col=currentColor; col.setAlphaF(0.5); }
+ else if (col==JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans75) { col=currentColor; col.setAlphaF(0.25); }
+ else if (col==JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans90) { col=currentColor; col.setAlphaF(0.1); }
+}
+
+void JKQTPReplaceCurrentColor(QGradient &grad, const QColor ¤tColor)
+{
+ auto stops=grad.stops();
+ for (auto& s: stops) {
+ JKQTPReplaceCurrentColor(s.second, currentColor);
+ }
+ grad.setStops(stops);
+}
diff --git a/lib/jkqtcommon/jkqtpdrawingtools.h b/lib/jkqtcommon/jkqtpdrawingtools.h
index 3046e8740a8..83c84eb521e 100644
--- a/lib/jkqtcommon/jkqtpdrawingtools.h
+++ b/lib/jkqtcommon/jkqtpdrawingtools.h
@@ -79,6 +79,36 @@ typedef std::function JKQTPCustomGraphSymbolFunctor;
\ingroup jkqtptools_drawing
*/
struct JKQTPlotterDrawingTools {
+ /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color" in a certain context
+ *
+ * \see JKQTPReplaceCurrentColor()
+ */
+ static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder;
+ /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 10% transparency in a certain context
+ *
+ * \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ...
+ */
+ static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans10;
+ /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 25% transparency in a certain context
+ *
+ * \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, ...
+ */
+ static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans25;
+ /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 50% transparency in a certain context
+ *
+ * \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ...
+ */
+ static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans50;
+ /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 75% transparency in a certain context
+ *
+ * \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ...
+ */
+ static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans75;
+ /** \brief a special placeholder that can be used to indicate that a color should be replaced by the "current color", but with 90% transparency in a certain context
+ *
+ * \see JKQTPReplaceCurrentColor(), JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ...
+ */
+ static JKQTCOMMON_LIB_EXPORT const QColor CurrentColorPlaceholder_Trans90;
/** \brief smallest linewidth any line in JKQTPlotter/JKQTBasePlotter may have
*/
static JKQTCOMMON_LIB_EXPORT const double ABS_MIN_LINEWIDTH;
@@ -93,6 +123,19 @@ struct JKQTPlotterDrawingTools {
+/*! \brief check whether \a col equals JKQTPlotterDrawingTools::CurrentColorPlaceholder (or one of its variants) and then replace it by \a currentColor
+ \ingroup jkqtptools_drawing
+
+ \see JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ...
+ */
+JKQTCOMMON_LIB_EXPORT void JKQTPReplaceCurrentColor(QColor& col, const QColor& currentColor);
+/*! \brief check whether any color in \a grad equals JKQTPlotterDrawingTools::CurrentColorPlaceholder (or one of its variants) and then replace it by \a currentColor
+ \ingroup jkqtptools_drawing
+
+ \see JKQTPlotterDrawingTools::CurrentColorPlaceholder, JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10, ...
+ */
+JKQTCOMMON_LIB_EXPORT void JKQTPReplaceCurrentColor(QGradient& grad, const QColor& currentColor);
+
/** \brief symbols that can be used to plot a datapoint for a graph
* \ingroup jkqtptools_drawing
diff --git a/lib/jkqtcommon/jkqtpstringtools.cpp b/lib/jkqtcommon/jkqtpstringtools.cpp
index 29355c389f1..0ca5a30df1a 100644
--- a/lib/jkqtcommon/jkqtpstringtools.cpp
+++ b/lib/jkqtcommon/jkqtpstringtools.cpp
@@ -21,6 +21,7 @@
#include "jkqtcommon/jkqtpstringtools.h"
#include "jkqtcommon/jkqtpmathtools.h"
#include "jkqtcommon/jkqtpcsstools.h"
+#include "jkqtcommon/jkqtpdrawingtools.h"
#include
#include
#include
@@ -653,6 +654,12 @@ QColor jkqtp_lookupQColorName(const QString &color, bool namesOnly, bool *nameFo
#if (QT_VERSION>=QT_VERSION_CHECK(5, 12, 0))
if (col=="placeholdertext") return QGuiApplication::palette().color(QPalette::PlaceholderText);
#endif
+ if (col=="currentcolor") return JKQTPlotterDrawingTools::CurrentColorPlaceholder;
+ if (col=="currentcolor10") return JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans10;
+ if (col=="currentcolor25") return JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans25;
+ if (col=="currentcolor50") return JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans50;
+ if (col=="currentcolor75") return JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans75;
+ if (col=="currentcolor90") return JKQTPlotterDrawingTools::CurrentColorPlaceholder_Trans90;
for (int i=0; istyles/simple_axesoffset_plotbox.ini
styles/simple_gridandticks.ini
styles/simple_arrowsaxes.ini
+ styles/simple_noaxes.ini
styles/legacy_default_style.ini
styles/cyberpunk.ini
diff --git a/lib/jkqtplotter/resources/styles/blackandwhite.ini b/lib/jkqtplotter/resources/styles/blackandwhite.ini
index 7339ae5a37e..323314e138f 100644
--- a/lib/jkqtplotter/resources/styles/blackandwhite.ini
+++ b/lib/jkqtplotter/resources/styles/blackandwhite.ini
@@ -9,6 +9,7 @@ graphs\graphs_base\error_color_mode=lighter
graphs\graphs_base\error_fill_color_mode=even_lighter_and_transparent
graphs\graphs_base\symbol_fill_color_mode=grey75
graphs\graphs_annotation\fill_color_mode=transparent
+graphs\graphs_geometric\color=black
graphs\graphs_barchart\linewidth=1
graphs\graphs_boxplot\fill_color_mode=white
text_default_size=10
diff --git a/lib/jkqtplotter/resources/styles/cyberpunk.ini b/lib/jkqtplotter/resources/styles/cyberpunk.ini
index 802902bc011..8e739503a3c 100644
--- a/lib/jkqtplotter/resources/styles/cyberpunk.ini
+++ b/lib/jkqtplotter/resources/styles/cyberpunk.ini
@@ -55,6 +55,7 @@ graphs\auto_styles\color2=#F5D300
graphs\auto_styles\color3=#00ff41
graphs\auto_styles\color4=#FF0000
graphs\auto_styles\color5=#9467bd
+graphs\auto_styles\fill_style0="linear-gradient(150deg,currentcolor10,currentcolor90)"
graphs\graphs_base\linewidth=2
graphs\graphs_base\symbol_size=10
graphs\graphs_base\symbol_line_width=1
diff --git a/lib/jkqtplotter/resources/styles/dark.ini b/lib/jkqtplotter/resources/styles/dark.ini
index 91293db6ab2..b96e22de690 100644
--- a/lib/jkqtplotter/resources/styles/dark.ini
+++ b/lib/jkqtplotter/resources/styles/dark.ini
@@ -56,6 +56,7 @@ graphs\auto_styles\color3="hsv(164,100%,90%)"
graphs\auto_styles\color4="hsv(42,100%,90%)"
graphs\auto_styles\color5="hsv(202,63%,90%)"
graphs\auto_styles\color6="hsv(0,0%,90%)"
+graphs\auto_styles\fill_style0="linear-gradient(150deg,currentcolor10,currentcolor50)"
graphs\graphs_base\linewidth=1
graphs\graphs_base\symbol_size=8
graphs\graphs_base\symbol_line_width=0.75
diff --git a/lib/jkqtplotter/resources/styles/default.ini b/lib/jkqtplotter/resources/styles/default.ini
index a9fe5cf2d8a..cf9ca0d1e68 100644
--- a/lib/jkqtplotter/resources/styles/default.ini
+++ b/lib/jkqtplotter/resources/styles/default.ini
@@ -70,10 +70,12 @@ key\xoffset=1
key\yoffset=1
key\xmargin=0.5
key\ymargin=0.5
-key\xseparation=0.75
-key\yseparation=0.75
+key\xseparation=0.85
+key\yseparation=0.35
+key\column_separation=0.75
key\frame_visible=true
key\frame_color=black
+key\frame_linestyle=solid
key\frame_width=1
key\frame_rounding=0
key\background_color=white
@@ -81,11 +83,10 @@ key\visible=true
key\position=inside_topright
key\layout=one_column
key\fontsize=9
+key\fontname=GUI
key\text_color=black
-key\item_width=20
-key\item_height=2.2
-key\line_width=3
-key\autosize=true
+key\sample_width=3
+key\sample_height=1
axis_x\color=black
axis_x\draw_mode1=complete
axis_x\draw_mode2=line+ticks
diff --git a/lib/jkqtplotter/resources/styles/simple_noaxes.ini b/lib/jkqtplotter/resources/styles/simple_noaxes.ini
new file mode 100644
index 00000000000..f96df8f5ac9
--- /dev/null
+++ b/lib/jkqtplotter/resources/styles/simple_noaxes.ini
@@ -0,0 +1,15 @@
+[plots]
+widget_background_color=white
+axis_x\draw_mode1=none
+axis_x\draw_mode2=none
+axis_x\zero_line\enabled=false
+axis_x\grid\enabled=false
+axis_y\draw_mode1=none
+axis_y\draw_mode2=none
+axis_y\grid\enabled=false
+axis_colorbar_right\draw_mode1=none
+axis_colorbar_right\draw_mode2=ticks+labels+axislabel
+axis_colorbar_top\draw_mode1=none
+axis_colorbar_top\draw_mode2=ticks+labels+axislabel
+graphs\graphs_geometric\color=black
+graphs\graphs_annotation\color=black
\ No newline at end of file
|