NEW: added JKQTBasePlotterStyle::plotLabelTopBorder and made plot labels BOLD

This commit is contained in:
jkriege2 2023-08-16 14:04:04 +02:00
parent 122371e743
commit fa50c3c130
84 changed files with 33 additions and 7 deletions

View File

@ -91,6 +91,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
<li>NEW: Using Q_SIGNALS/Q_SLOTS instead of signals/slots MOC-keywords ... this allows for interoperability with other signals/slots frameworks, thanks to <a href="https://github.com/nickmontini">user:nickmontini</a> for the proposal</li>
<li>NEW: you can use any (preferably stepped/categorial) JKQTPMathImageColorPalette as default graph colors list in a style.ini file, by setting <tt>auto_styles/use_color_from_palette=PALETTE_NAME</tt></li>
<li>NEW: added entry for JKQTBasePlotterStyle::plotLabelColor to set the plot label color</li>
<li>NEW: added JKQTBasePlotterStyle::plotLabelTopBorder to set the spacing between top and plot label</li>
<li>NEW: Due to addition of JKQTMathText::setFontOptions() and the matchign extension of JKQTMathText::setFontSpecial() (see below) you can now add modifiers like <tt>+BOLD+ITALIC</tt> to any font-name provided to JKQTPlotter and in style INI-files</li>
</ul></li>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -821,7 +821,7 @@ void JKQTBasePlotter::calcPlotScaling(JKQTPEnhancedPainter& painter){
if (!plotLabel.isEmpty()) {
QSizeF s=getTextSizeSize(plotterStyle.plotLabelFontName, plotterStyle.plotLabelFontSize*fontSizeMultiplier, plotLabel, painter);
internalTitleHeight=s.height()+2.0*pt2px(painter, plotterStyle.plotLabelOffset);
internalTitleHeight=s.height()+pt2px(painter, plotterStyle.plotLabelOffset)+pt2px(painter, plotterStyle.plotLabelTopBorder);
internalPlotBorderTop+=internalTitleHeight;
}
@ -1378,7 +1378,7 @@ void JKQTBasePlotter::drawPlot(JKQTPEnhancedPainter& painter) {
double a=0,d=0,so=0,w=0;
getTextSizeDetail(plotterStyle.plotLabelFontName,plotterStyle.plotLabelFontSize*fontSizeMultiplier,plotLabel, painter, w, a, d, so);
QSizeF s=QSizeF(w, a+d);
mathText.draw(painter, internalPlotBorderLeft+(internalPlotWidth-s.width())/2.0,plotterStyle.plotBorderTop+a+pt2px(painter, plotterStyle.plotLabelOffset), plotterStyle.debugShowTextBoxes);
mathText.draw(painter, internalPlotBorderLeft+(internalPlotWidth-s.width())/2.0,plotterStyle.plotBorderTop+a+pt2px(painter, plotterStyle.plotLabelTopBorder), plotterStyle.debugShowTextBoxes);
if (plotterStyle.debugShowRegionBoxes) {
painter.save(); auto __finalpaint=JKQTPFinally([&painter]() {painter.restore();});
QPen p("blue");
@ -3011,6 +3011,20 @@ double JKQTBasePlotter::getPlotLabelOffset() const
{
return this->plotterStyle.plotLabelOffset;
}
void JKQTBasePlotter::setPlotLabelTopBorder(double __value)
{
if (jkqtp_approximatelyUnequal(this->plotterStyle.plotLabelTopBorder , __value)) {
this->plotterStyle.plotLabelTopBorder = __value;
redrawPlot();
}
}
double JKQTBasePlotter::getPlotLabelTopBorder() const
{
return this->plotterStyle.plotLabelTopBorder;
}
void JKQTBasePlotter::setPlotLabelColor(QColor __value)
{
if (this->plotterStyle.plotLabelColor != __value) {

View File

@ -1139,6 +1139,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
double getPlotLabelFontSize() const;
/** \copydoc JKQTBasePlotterStyle::plotLabelOffset */
double getPlotLabelOffset() const;
/** \copydoc JKQTBasePlotterStyle::plotLabelTopBorder */
double getPlotLabelTopBorder() const;
/** \copydoc JKQTBasePlotterStyle::plotLabelFontName */
QString getplotLabelFontName() const;
/** \copydoc JKQTBasePlotterStyle::plotLabelColor */
@ -2017,6 +2019,8 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotter: public QObject {
void setPlotLabelFontSize(double __value);
/** \copydoc JKQTBasePlotterStyle::plotLabelOffset */
void setPlotLabelOffset(double __value);
/** \copydoc JKQTBasePlotterStyle::plotLabelTopBorder */
void setPlotLabelTopBorder(double __value);
/** \copydoc JKQTBasePlotterStyle::plotLabelFontName */
void setplotLabelFontName(const QString & __value);
/** \copydoc JKQTBasePlotterStyle::plotLabelColor */

View File

@ -21,9 +21,10 @@ JKQTBasePlotterStyle::JKQTBasePlotterStyle():
plotFrameWidth(1),
plotFrameRounding(0),
plotFrameVisible(false),
plotLabelFontName("GUI"),
plotLabelFontSize(qCeil(QApplication::font().pointSizeF()*1.2)),
plotLabelFontName("GUI+BOLD"),
plotLabelFontSize(qCeil(QApplication::font().pointSizeF()*1.5)),
plotLabelOffset(qCeil(QApplication::font().pointSizeF()*0.4)),
plotLabelTopBorder(qCeil(QApplication::font().pointSizeF()*0.25)),
useAntiAliasingForSystem(true),
useAntiAliasingForText(true),
defaultTextColor(QColor("black")),
@ -54,6 +55,7 @@ void JKQTBasePlotterStyle::loadSettings(const QSettings &settings, const QString
plotLabelFontName=settings.value(group+"plot_label_font_name", defaultStyle.plotLabelFontName).toString();
plotLabelFontSize=settings.value(group+"plot_label_font_size", defaultStyle.plotLabelFontSize).toDouble();
plotLabelOffset=settings.value(group+"plot_label_offset", defaultStyle.plotLabelOffset).toDouble();
plotLabelTopBorder=settings.value(group+"plot_label_top_border", defaultStyle.plotLabelTopBorder).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()));
@ -103,6 +105,7 @@ void JKQTBasePlotterStyle::saveSettings(QSettings &settings, const QString &grou
settings.setValue(group+"plot_label_font_name", plotLabelFontName);
settings.setValue(group+"plot_label_font_size", plotLabelFontSize);
settings.setValue(group+"plot_label_offset", plotLabelOffset);
settings.setValue(group+"plot_label_top_border", plotLabelTopBorder);
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));

View File

@ -141,8 +141,10 @@ class JKQTPLOTTER_LIB_EXPORT JKQTBasePlotterStyle {
double plotLabelFontSize;
/** \brief the plot label color */
QColor plotLabelColor;
/** \brief offset of the plot label from the next element [pt]. This offset is added below AND above the plot label! */
/** \brief offset of the plot label from the next element of the graph, i.e. below the label [pt]. \see plotLabelTopBorder for spacing above */
double plotLabelOffset;
/** \brief offset of the plot label from the top [pt]. \see plotLabelOffset for spacing between label and graph */
double plotLabelTopBorder;
/** \brief specifies whether to use antialiasing for plotting the coordinate system */
bool useAntiAliasingForSystem;
/** \brief specifies whether to use antialiasing when drawing any text

View File

@ -56,8 +56,10 @@ plot_border_bottom=5
text_default_color=black
text_default_size=9
text_default_font_name=GUI
plot_label_font_name=GUI
plot_label_font_size=11
plot_label_font_name=GUI+BOLD
plot_label_font_size=14
plot_label_offset=4
plot_label_top_border=3
plot_label_color=black
plot_frame_visible=false
plot_frame_color=black

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB