diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox
index 88dd7f8472..69cb5ae8a0 100644
--- a/doc/dox/whatsnew.dox
+++ b/doc/dox/whatsnew.dox
@@ -87,6 +87,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
NEW: add color palettes from Green's HELIX method, see https://arxiv.org/abs/1108.5083, also see https://jiffyclub.github.io/palettable/cubehelix/, see JKQTPCreateGreensCubeHelixLUT() and e.g. JKQTPMathImageCubeHelixClassic, JKQTPMathImageCubeHelix1, ...
NEW: Using Q_SIGNALS/Q_SLOTS instead of signals/slots MOC-keywords ... this allows for interoperability with other signals/slots frameworks, thanks to user:nickmontini for the proposal
NEW: you can use any (preferably stepped/categorial) JKQTPMathImageColorPalette as default graph colors list in a style.ini file, by setting auto_styles/use_color_from_palette=PALETTE_NAME
+ NEW added entry for plotLabelColor to JKQTBasePlotterStyle
JKQTMathText:
diff --git a/examples/styling/build_test_graphs.h b/examples/styling/build_test_graphs.h
index 0c625d365b..5773437b29 100644
--- a/examples/styling/build_test_graphs.h
+++ b/examples/styling/build_test_graphs.h
@@ -270,6 +270,7 @@ inline void buildLineSymbolSampler(JKQTBasePlotter* plotExtra, JKQTBasePlotter*
plotExtra->setBackgroundColor(baseplot->getBackgroundColor());
plotExtra->setExportBackgroundColor(baseplot->getExportBackgroundColor());
plotExtra->setPlotBackgroundColor(baseplot->getPlotBackgroundColor());
+ plotExtra->setPlotLabelColor(baseplot->getPlotLabelColor());
plotExtra->getXAxis()->setDrawMode1(JKQTPCADMnone);
plotExtra->getXAxis()->setDrawMode2(JKQTPCADMnone);
plotExtra->getYAxis()->setDrawMode1(JKQTPCADMnone);
diff --git a/lib/jkqtplotter/jkqtpbaseplotter.cpp b/lib/jkqtplotter/jkqtpbaseplotter.cpp
index 17bc89e428..4da0014aa9 100644
--- a/lib/jkqtplotter/jkqtpbaseplotter.cpp
+++ b/lib/jkqtplotter/jkqtpbaseplotter.cpp
@@ -1372,6 +1372,7 @@ void JKQTBasePlotter::drawPlot(JKQTPEnhancedPainter& painter) {
if (!plotLabel.isEmpty()) {
mathText.setFontSize(plotterStyle.plotLabelFontSize*fontSizeMultiplier);
mathText.setFontSpecial(plotterStyle.plotLabelFontName);
+ mathText.setFontColor(plotterStyle.plotLabelColor);
mathText.parse(plotLabel);
double a=0,d=0,so=0,w=0;
@@ -2998,6 +2999,19 @@ double JKQTBasePlotter::getPlotLabelFontSize() const
return this->plotterStyle.plotLabelFontSize;
}
+void JKQTBasePlotter::setPlotLabelColor(QColor __value)
+{
+ if (this->plotterStyle.plotLabelColor != __value) {
+ this->plotterStyle.plotLabelColor = __value;
+ redrawPlot();
+ }
+}
+
+QColor JKQTBasePlotter::getPlotLabelColor() const
+{
+ return this->plotterStyle.plotLabelColor;
+}
+
void JKQTBasePlotter::setplotLabelFontName(const QString &__value)
{
if (this->plotterStyle.plotLabelFontName != __value) {
diff --git a/lib/jkqtplotter/jkqtpbaseplotter.h b/lib/jkqtplotter/jkqtpbaseplotter.h
index 3ce14708d6..a5c9cce9a8 100644
--- a/lib/jkqtplotter/jkqtpbaseplotter.h
+++ b/lib/jkqtplotter/jkqtpbaseplotter.h
@@ -1139,6 +1139,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
double getPlotLabelFontSize() const;
/** \copydoc JKQTBasePlotterStyle::plotLabelFontName */
QString getplotLabelFontName() const;
+ /** \copydoc JKQTBasePlotterStyle::plotLabelColor */
+ QColor getPlotLabelColor() const;
/** \copydoc plotLabel */
QString getPlotLabel() const;
@@ -2013,6 +2015,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
void setPlotLabelFontSize(double __value);
/** \copydoc JKQTBasePlotterStyle::plotLabelFontName */
void setplotLabelFontName(const QString & __value);
+ /** \copydoc JKQTBasePlotterStyle::plotLabelColor */
+ void setPlotLabelColor(QColor __value);
/** \brief set the plot label text */
void setPlotLabel(const QString & __value);
/** \copydoc JKQTBasePlotterStyle::defaultTextColor */
diff --git a/lib/jkqtplotter/jkqtpbaseplotterstyle.cpp b/lib/jkqtplotter/jkqtpbaseplotterstyle.cpp
index 079d22637d..3af3b0e8d8 100644
--- a/lib/jkqtplotter/jkqtpbaseplotterstyle.cpp
+++ b/lib/jkqtplotter/jkqtpbaseplotterstyle.cpp
@@ -52,6 +52,7 @@ void JKQTBasePlotterStyle::loadSettings(const QSettings &settings, const QString
debugTextBoxLineWidth=settings.value(group+"debug_textbox_linewidth", defaultStyle.debugTextBoxLineWidth).toDouble();
plotLabelFontName=settings.value(group+"plot_label_font_name", defaultStyle.plotLabelFontName).toString();
plotLabelFontSize=settings.value(group+"plot_label_font_size", defaultStyle.plotLabelFontSize).toDouble();
+ plotLabelColor=jkqtp_String2QColor(settings.value(group+"plot_label_color", jkqtp_QColor2String(defaultStyle.plotLabelColor)).toString());
widgetBackgroundBrush=QBrush(jkqtp_String2QColor(settings.value(group+"widget_background_color", jkqtp_QColor2String(defaultStyle.widgetBackgroundBrush.color())).toString()));
exportBackgroundBrush=QBrush(jkqtp_String2QColor(settings.value(group+"widget_background_color_for_export", jkqtp_QColor2String(defaultStyle.exportBackgroundBrush.color())).toString()));
plotBackgroundBrush=QBrush(jkqtp_String2QColor(settings.value(group+"plot_background_color", jkqtp_QColor2String(defaultStyle.plotBackgroundBrush.color())).toString()));
@@ -99,6 +100,7 @@ void JKQTBasePlotterStyle::saveSettings(QSettings &settings, const QString &grou
settings.setValue(group+"text_default_font_name", defaultFontName);
settings.setValue(group+"plot_label_font_name", plotLabelFontName);
settings.setValue(group+"plot_label_font_size", plotLabelFontSize);
+ settings.setValue(group+"plot_label_color", jkqtp_QColor2String(plotLabelColor));
settings.setValue(group+"plot_frame_visible", plotFrameVisible);
settings.setValue(group+"plot_frame_color", jkqtp_QColor2String(plotFrameColor));
settings.setValue(group+"plot_frame_width", plotFrameWidth);
diff --git a/lib/jkqtplotter/jkqtpbaseplotterstyle.h b/lib/jkqtplotter/jkqtpbaseplotterstyle.h
index f65abf0551..6db7c32f26 100644
--- a/lib/jkqtplotter/jkqtpbaseplotterstyle.h
+++ b/lib/jkqtplotter/jkqtpbaseplotterstyle.h
@@ -139,6 +139,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotterStyle {
QString plotLabelFontName;
/** \brief the plot label font size [pt] */
double plotLabelFontSize;
+ /** \brief the plot label color */
+ QColor plotLabelColor;
/** \brief specifies whether to use antialiasing for plotting the coordinate system */
bool useAntiAliasingForSystem;
/** \brief specifies whether to use antialiasing when drawing any text