21#ifndef jkqtpgraphlabelstylemixin_H
22#define jkqtpgraphlabelstylemixin_H
29#include "jkqtplotter/jkqtptools.h"
30#include "jkqtplotter/jkqtplotter_imexport.h"
31#include "jkqtplotter/jkqtpbaseplotter.h"
32#include "jkqtcommon/jkqtpdrawingtools.h"
33#include "jkqtplotter/jkqtplotter_configmacros.h"
34#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
119#ifndef JKQTPLOTTER_WORKAROUND_QGADGET_BUG
195#ifndef JKQTPLOTTER_WORKAROUND_QGADGET_BUG
317#ifndef JKQTPLOTTER_WORKAROUND_QGADGET_BUG
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
JKQTPGraphFillStyleMixin()
class constructor
JKQTPGraphLineStyleMixin()
class constructor
JKQTPGraphTextStyleMixin(JKQTBasePlotter *parent)
class constructor
double labelBoxRounding
Definition jkqtpgraphlabelstylemixin.h:198
JKQTPGraphLabelBoxType labelBoxType
Definition jkqtpgraphlabelstylemixin.h:203
void setLabelBoxType(JKQTPGraphLabelBoxType r)
type or style of the box surrounding the label text
double m_labelBoxRounding
rounding radius of the box rectangle (<=0 -> no rounded rectangle) [pt]
Definition jkqtpgraphlabelstylemixin.h:267
bool m_drawLabelBoxFrame
indicates whether to draw a frame around the box *
Definition jkqtpgraphlabelstylemixin.h:282
void setLabelYPadding(double r)
padding in y-direction between label and surrounding box [pt] *
bool isLabelPositioningGrowingInY() const
determines whether a label is positioned below the mininmum, or above the maxinmum datapoint (true )
double labelYPadding
Definition jkqtpgraphlabelstylemixin.h:200
double m_labelYPadding
padding in y-direction between label and surrounding box [pt] *
Definition jkqtpgraphlabelstylemixin.h:277
virtual ~JKQTPGraphValueLabelStyleMixin()
double getLabelOffsetWithConnector() const
offset of the box rectangle to the actual data point location [pt], this variant is used when a visib...
void setDrawLabelBoxFrame(bool r)
indicates whether to draw a frame around the box *
JKQTPGraphLabelPosition getLabelPosition() const
position of the label
bool drawLabelBoxFrame
Definition jkqtpgraphlabelstylemixin.h:202
double labelXPadding
Definition jkqtpgraphlabelstylemixin.h:199
void setLabelOffset(double r)
offset of the box rectangle to the actual data point location [pt], this is used for simple boxes and...
JKQTPGraphLabelBoxType m_labelBoxType
type or style of the box surrounding the label text
Definition jkqtpgraphlabelstylemixin.h:292
void setLabelOffsetWithConnector(double r)
offset of the box rectangle to the actual data point location [pt], this variant is used when a visib...
double getLabelBoxRounding() const
rounding radius of the box rectangle (<=0 -> no rounded rectangle) [pt]
void setLabelBoxRounding(double r)
rounding radius of the box rectangle (<=0 -> no rounded rectangle) [pt]
LabelGeometry calcLabelGeometry(JKQTPEnhancedPainter &painter, const QPointF &xDataPixel, const QPointF &xData, const QString &contents, JKQTBasePlotter *parent, double baselineX, double baselineY) const
calculate everything that is necessary to draw a label, including its box
void initValueLabelStyle(JKQTBasePlotter *parent, int &parentPlotStyle, JKQTPPlotStyleType styletype=JKQTPPlotStyleType::Default)
initiaize the fill style (from the parent plotter)
double labelOffset
Definition jkqtpgraphlabelstylemixin.h:196
double getLabelXPadding() const
padding in x-direction between label and surrounding box [pt]
void drawLabel(JKQTPEnhancedPainter &painter, const QPointF &xDataPixel, const QPointF &xData, const QString &contents, JKQTBasePlotter *parent, double baselineX, double baselineY) const
draws a label, including its box
double getLabelOffset() const
offset of the box rectangle to the actual data point location [pt], this is used for simple boxes and...
double m_labelOffset
offset of the box rectangle to the actual data point location [pt], this is used for simple boxes and...
Definition jkqtpgraphlabelstylemixin.h:258
double m_labelOffsetWithConnector
offset of the box rectangle to the actual data point location [pt], this variant is used when a visib...
Definition jkqtpgraphlabelstylemixin.h:265
void setLabelXPadding(double r)
padding in x-direction between label and surrounding box [pt]
double getLabelYPadding() const
padding in y-direction between label and surrounding box [pt] *
JKQTPGraphLabelPosition labelPosition
Definition jkqtpgraphlabelstylemixin.h:201
JKQTPGraphLabelPosition m_labelPosition
position of the label
Definition jkqtpgraphlabelstylemixin.h:287
JKQTPGraphValueLabelStyleMixin(JKQTBasePlotter *parent)
class constructor
double m_labelXPadding
padding in x-direction between label and surrounding box [pt]
Definition jkqtpgraphlabelstylemixin.h:272
double getUsedLabelOffset() const
determines, whether to use getLabelOffset() or getLabelOffsetWithConnector() (or something else) and ...
void setLabelPosition(JKQTPGraphLabelPosition r)
position of the label
bool isLabelPositioningGrowingInX() const
determines whether a label is positioned left of the mininmum, or right of the maxinmum datapoint (tr...
double labelOffsetWithConnector
Definition jkqtpgraphlabelstylemixin.h:197
JKQTPGraphLabelBoxType getLabelBoxType() const
type or style of the box surrounding the label text
bool drawsLabelBoxFrame() const
indicates whether to draw a frame around the box *
QString getYValueLabelFormat() const
format string for the y-label, use %1 as placeholder for the numeric value
QString getXDateTimeFormat() const
format string for datetime -> string conversion of x-values
double getYMaxNoExponent() const
y-values above this value will be shown in exponent notation, below in decimal notation
QString generateDefaultXYLabel(double x, double y, int index) const
default label generator for x- and y-value
QString getXValueLabelFormat() const
format string for the x-label, use %1 as placeholder for the numeric value
void setXValueLabelFormat(const QString &v)
format string for the x-label, use %1 as placeholder for the numeric value
void setXMinNoExponent(double v)
x-values below this value will be shown in exponent notation, above in decimal notation
void setXDefaultConverter(JKQTPGraphLabelConverterType v)
type of number to string conversion for x-values
double m_yBelowIsZero
y-values below this value are treated as exactly 0
Definition jkqtpgraphlabelstylemixin.h:434
QString generateDefaultXLabel(double x, double y, int index) const
default label generator for x-value only
static QString valToString(double x, JKQTPGraphLabelConverterType m_xDefaultConverter, int m_xDefaultPrecision, double m_xBelowIsZero, double m_xMinNoExponent, double m_xMaxNoExponent, const QString &m_xDateTimeFormat)
converts x to a QString, using the provided options
double getXBelowIsZero() const
x-values below this value are treated as exactly 0
JKQTPGraphLabelConverterType m_xDefaultConverter
type of number to string conversion for x-values
Definition jkqtpgraphlabelstylemixin.h:424
JKQTPXYLabelsGeneratorMixin()
class constructor
QString generateDefaultYLabel(double x, double y, int index) const
default label generator for y-value only
void setYDateTimeFormat(const QString &v)
format string for datetime -> string conversion of y-value
double getXMaxNoExponent() const
x-values above this value will be shown in exponent notation, below in decimal notation
void setYMinNoExponent(double v)
y-values below this value will be shown in exponent notation, above in decimal notation
virtual ~JKQTPXYLabelsGeneratorMixin()
double m_yMinNoExponent
y-values below this value will be shown in exponent notation, above in decimal notation
Definition jkqtpgraphlabelstylemixin.h:438
double getXMinNoExponent() const
x-values below this value will be shown in exponent notation, above in decimal notation
QString yValToString(double y) const
converts y to a string, using several of the formatting properties set in this class for y-values
void setYDefaultPrecision(int v)
default precision for x-labels
void setYMaxNoExponent(double v)
y-values above this value will be shown in exponent notation, below in decimal notation
QString m_xValueLabelFormat
format string for the x-label, use %1 as placeholder for the numeric value
Definition jkqtpgraphlabelstylemixin.h:418
QString xValToString(double x) const
converts x to a string, using several of the formatting properties set in this class for x-values
QString m_yValueLabelFormat
format string for the y-label, use %1 as placeholder for the numeric value
Definition jkqtpgraphlabelstylemixin.h:420
int m_yDefaultPrecision
default precision for x-labels
Definition jkqtpgraphlabelstylemixin.h:430
void setXYValueLabelFormat(const QString &v)
format string for the x/y-label, use %1 as placeholder for the numeric value of x and %2 for y
QString getXYValueLabelFormat() const
format string for the x/y-label, use %1 as placeholder for the numeric value of x and %2 for y
double getYMinNoExponent() const
y-values below this value will be shown in exponent notation, above in decimal notation
QString getYDateTimeFormat() const
format string for datetime -> string conversion of y-value
void setXMaxNoExponent(double v)
x-values above this value will be shown in exponent notation, below in decimal notation
void setXDateTimeFormat(const QString &v)
format string for datetime -> string conversion of x-values
void setYBelowIsZero(double v)
y-values below this value are treated as exactly 0
JKQTPGraphLabelConverterType m_yDefaultConverter
type of number to string conversion for y-values
Definition jkqtpgraphlabelstylemixin.h:426
QString m_xDateTimeFormat
format string for datetime -> string conversion of x-values
Definition jkqtpgraphlabelstylemixin.h:444
void setXBelowIsZero(double v)
x-values below this value are treated as exactly 0
double m_xMaxNoExponent
x-values above this value will be shown in exponent notation, below in decimal notation
Definition jkqtpgraphlabelstylemixin.h:440
void setYValueLabelFormat(const QString &v)
format string for the y-label, use %1 as placeholder for the numeric value
JKQTPGraphLabelConverterType getYDefaultConverter() const
type of number to string conversion for y-values
int getXDefaultPrecision() const
default precision for x-labels
int m_xDefaultPrecision
default precision for x-labels
Definition jkqtpgraphlabelstylemixin.h:428
int getYDefaultPrecision() const
default precision for x-labels
QString m_yDateTimeFormat
format string for datetime -> string conversion of y-value
Definition jkqtpgraphlabelstylemixin.h:446
void setXDefaultPrecision(int v)
default precision for x-labels
void setYDefaultConverter(JKQTPGraphLabelConverterType v)
type of number to string conversion for y-values
double getYBelowIsZero() const
y-values below this value are treated as exactly 0
double m_yMaxNoExponent
y-values above this value will be shown in exponent notation, below in decimal notation
Definition jkqtpgraphlabelstylemixin.h:442
double m_xBelowIsZero
x-values below this value are treated as exactly 0
Definition jkqtpgraphlabelstylemixin.h:432
double m_xMinNoExponent
x-values below this value will be shown in exponent notation, above in decimal notation
Definition jkqtpgraphlabelstylemixin.h:436
JKQTPGraphLabelConverterType getXDefaultConverter() const
type of number to string conversion for x-values
QString m_xyValueLabelFormat
format string for the x/y-label, use %1 as placeholder for the numeric value of x and %2 for y
Definition jkqtpgraphlabelstylemixin.h:422
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:374
JKQTPGraphLabelPosition
position of a label near a data-point, used by JKQTPGraphValueLabelStyleMixin
Definition jkqtpgraphlabelstylemixin.h:46
JKQTPLOTTER_LIB_EXPORT QString JKQTPGraphLabelBoxType2String(JKQTPGraphLabelBoxType pos)
converts a JKQTPGraphLabelBoxType variable into a human-readable string
JKQTPGraphLabelConverterType
display mode for the (axis) labels
Definition jkqtpgraphlabelstylemixin.h:300
JKQTPLOTTER_LIB_EXPORT JKQTPGraphLabelBoxType String2JKQTPGraphLabelBoxType(const QString &pos)
converts a String into a JKQTPGraphLabelBoxType
JKQTPLOTTER_LIB_EXPORT JKQTPGraphLabelPosition String2JKQTPGraphLabelPosition(const QString &pos)
converts a String into a JKQTPGraphLabelPosition
JKQTPLOTTER_LIB_EXPORT QString JKQTPGraphLabelPosition2String(JKQTPGraphLabelPosition pos)
converts a JKQTPGraphLabelPosition variable into a human-readable string
JKQTPGraphLabelBoxType
type of box surrounding a label near a data-point, used by JKQTPGraphValueLabelStyleMixin
Definition jkqtpgraphlabelstylemixin.h:79
@ JKQTPGLabelAwayFromYAxis
all labels pointing away from the y-axis
Definition jkqtpgraphlabelstylemixin.h:54
@ JKQTPGLabelLeftHandSide
all labels always on the left-hand side of the datapoint
Definition jkqtpgraphlabelstylemixin.h:52
@ JKQTPGLabelHalfwaysToYAxis
all labels half-ways between the datapoint and the y-axis the datapoint
Definition jkqtpgraphlabelstylemixin.h:57
@ JKQTPGLabelAwayFromXAxis
all labels pointing away from the x-axis
Definition jkqtpgraphlabelstylemixin.h:50
@ JKQTPGLabelTowardsYAxis
all labels between the datapoint and the y-axis the datapoint
Definition jkqtpgraphlabelstylemixin.h:53
@ JKQTPGLabelCenteredOnData
graph label is drawn centered arond the data point (x,y)
Definition jkqtpgraphlabelstylemixin.h:55
@ JKQTPGLabelTowardsXAxis
all labels between the datapoint and the x-axis the datapoint
Definition jkqtpgraphlabelstylemixin.h:49
@ JKQTPGLabelHalfwaysToXAxis
all labels half-ways between the datapoint and the x-axis the datapoint
Definition jkqtpgraphlabelstylemixin.h:56
@ JKQTPGLabelAboveData
all labels always above the datapoint
Definition jkqtpgraphlabelstylemixin.h:47
@ JKQTPGraphLabelDefault
Definition jkqtpgraphlabelstylemixin.h:60
@ JKQTPGLabelBelowData
all labels always below the datapoint
Definition jkqtpgraphlabelstylemixin.h:48
@ JKQTPGLabelRightHandSide
all labels always on the right-hand side of the datapoint
Definition jkqtpgraphlabelstylemixin.h:51
@ JKQTPGLCexponent
show numbers in exponential for, e.g. ...
Definition jkqtpgraphlabelstylemixin.h:304
@ JKQTPGLDefaultConverter
Definition jkqtpgraphlabelstylemixin.h:307
@ JKQTPGLCdecimal
print the numbers in decimal notation, without using exponent characters e.g. "0.00123"
Definition jkqtpgraphlabelstylemixin.h:301
@ JKQTPGLCscientific
print the numbers in scientific notation, e.g. "1.23e-4"
Definition jkqtpgraphlabelstylemixin.h:302
@ JKQTPGLCexponentCharacter
print the numbers and show a unit character, i.e. 5μ for , 3k for ...
Definition jkqtpgraphlabelstylemixin.h:303
@ JKQTPGLCdatetime
show numbers as times
Definition jkqtpgraphlabelstylemixin.h:305
@ JKQTPGLSimpleBoxAndLine
a simple (possibly rounded and outlined) box, connected to the datapoint by a line
Definition jkqtpgraphlabelstylemixin.h:81
@ JKQTPGLSimpleBox
a simple (possibly rounded and outlined) box
Definition jkqtpgraphlabelstylemixin.h:80
@ JKQTPGraphLabelBoxDefault
Definition jkqtpgraphlabelstylemixin.h:83
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
JKQTPPlotStyleType
used to specify teh type of graph when calling getPlotStyle()
Definition jkqtptools.h:68
@ Default
Definition jkqtptools.h:69
beschreibt die Größe(n) eines Knotens
Definition jkqtmathtexttools.h:393
describes details about the geometry of a label, used by calcLabelGeometry()
Definition jkqtpgraphlabelstylemixin.h:208
LabelGeometry()
Definition jkqtpgraphlabelstylemixin.h:209
QRectF textRect
Definition jkqtpgraphlabelstylemixin.h:226
BoxPos boxpos
Definition jkqtpgraphlabelstylemixin.h:235
double lw
Definition jkqtpgraphlabelstylemixin.h:223
BoxPos
Definition jkqtpgraphlabelstylemixin.h:228
@ BoxTop
Definition jkqtpgraphlabelstylemixin.h:231
@ BoxCentered
Definition jkqtpgraphlabelstylemixin.h:233
@ BoxRight
Definition jkqtpgraphlabelstylemixin.h:230
@ BoxLeft
Definition jkqtpgraphlabelstylemixin.h:229
@ BoxBottom
Definition jkqtpgraphlabelstylemixin.h:232
JKQTMathTextNodeSize textSize
Definition jkqtpgraphlabelstylemixin.h:225
double padX
Definition jkqtpgraphlabelstylemixin.h:221
QRectF boxRect
Definition jkqtpgraphlabelstylemixin.h:227
QString label
Definition jkqtpgraphlabelstylemixin.h:224
double labelOffsetPx
Definition jkqtpgraphlabelstylemixin.h:220
double padY
Definition jkqtpgraphlabelstylemixin.h:222