JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
Loading...
Searching...
No Matches

This Mix-In class provides setter/getter methods, and tools for x- and y-value label formatting (i.e. double to string conversion) More...

#include <jkqtpgraphlabelstylemixin.h>

Inheritance diagram for JKQTPXYLabelsGeneratorMixin:
[legend]

Public Member Functions

 JKQTPXYLabelsGeneratorMixin ()
 class constructor
 
virtual ~JKQTPXYLabelsGeneratorMixin ()
 
double getXBelowIsZero () const
 x-values below this value are treated as exactly 0
 
QString getXDateTimeFormat () const
 format string for datetime -> string conversion of x-values
 
JKQTPGraphLabelConverterType getXDefaultConverter () const
 type of number to string conversion for x-values
 
int getXDefaultPrecision () const
 default precision for x-labels
 
double getXMaxNoExponent () const
 x-values above this value will be shown in exponent notation, below in decimal notation
 
double getXMinNoExponent () const
 x-values below this value will be shown in exponent notation, above in decimal notation
 
QString getXValueLabelFormat () const
 format string for the x-label, use %1 as placeholder for the numeric value
 
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 getYBelowIsZero () const
 y-values below this value are treated as exactly 0
 
QString getYDateTimeFormat () const
 format string for datetime -> string conversion of y-value
 
JKQTPGraphLabelConverterType getYDefaultConverter () const
 type of number to string conversion for y-values
 
int getYDefaultPrecision () const
 default precision for x-labels
 
double getYMaxNoExponent () const
 y-values above this value will be shown in exponent notation, below in decimal notation
 
double getYMinNoExponent () const
 y-values below this value will be shown in exponent notation, above in decimal notation
 
QString getYValueLabelFormat () const
 format string for the y-label, use %1 as placeholder for the numeric value
 
void setXBelowIsZero (double v)
 x-values below this value are treated as exactly 0
 
void setXDateTimeFormat (const QString &v)
 format string for datetime -> string conversion of x-values
 
void setXDefaultConverter (JKQTPGraphLabelConverterType v)
 type of number to string conversion for x-values
 
void setXDefaultPrecision (int v)
 default precision for x-labels
 
void setXMaxNoExponent (double v)
 x-values above this value will be shown in exponent notation, below in decimal notation
 
void setXMinNoExponent (double v)
 x-values below this value will be shown in exponent notation, above in decimal notation
 
void setXValueLabelFormat (const QString &v)
 format string for the x-label, use %1 as placeholder for the numeric value
 
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
 
void setYBelowIsZero (double v)
 y-values below this value are treated as exactly 0
 
void setYDateTimeFormat (const QString &v)
 format string for datetime -> string conversion of y-value
 
void setYDefaultConverter (JKQTPGraphLabelConverterType v)
 type of number to string conversion 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
 
void setYMinNoExponent (double v)
 y-values below this value will be shown in exponent notation, above in decimal notation
 
void setYValueLabelFormat (const QString &v)
 format string for the y-label, use %1 as placeholder for the numeric value
 

Protected Member Functions

QString generateDefaultXLabel (double x, double y, int index) const
 default label generator for x-value only
 
QString generateDefaultXYLabel (double x, double y, int index) const
 default label generator for x- and y-value
 
QString generateDefaultYLabel (double x, double y, int index) const
 default label generator for y-value only
 
QString xValToString (double x) const
 converts x to a string, using several of the formatting properties set in this class for x-values
 
QString yValToString (double y) const
 converts y to a string, using several of the formatting properties set in this class for y-values
 

Static Protected Member Functions

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
 

Private Attributes

double m_xBelowIsZero
 x-values below this value are treated as exactly 0
 
QString m_xDateTimeFormat
 format string for datetime -> string conversion of x-values
 
JKQTPGraphLabelConverterType m_xDefaultConverter
 type of number to string conversion for x-values
 
int m_xDefaultPrecision
 default precision for x-labels
 
double m_xMaxNoExponent
 x-values above this value will be shown in exponent notation, below in decimal notation
 
double m_xMinNoExponent
 x-values below this value will be shown in exponent notation, above in decimal notation
 
QString m_xValueLabelFormat
 format string for the x-label, use %1 as placeholder for the numeric value
 
QString m_xyValueLabelFormat
 format string for the x/y-label, use %1 as placeholder for the numeric value of x and %2 for y
 
double m_yBelowIsZero
 y-values below this value are treated as exactly 0
 
QString m_yDateTimeFormat
 format string for datetime -> string conversion of y-value
 
JKQTPGraphLabelConverterType m_yDefaultConverter
 type of number to string conversion for y-values
 
int m_yDefaultPrecision
 default precision for x-labels
 
double m_yMaxNoExponent
 y-values above this value will be shown in exponent notation, below in decimal notation
 
double m_yMinNoExponent
 y-values below this value will be shown in exponent notation, above in decimal notation
 
QString m_yValueLabelFormat
 format string for the y-label, use %1 as placeholder for the numeric value
 

Detailed Description

This Mix-In class provides setter/getter methods, and tools for x- and y-value label formatting (i.e. double to string conversion)

See also
JKQTPXYGraphLabels

Constructor & Destructor Documentation

◆ JKQTPXYLabelsGeneratorMixin()

JKQTPXYLabelsGeneratorMixin::JKQTPXYLabelsGeneratorMixin ( )
explicit

class constructor

◆ ~JKQTPXYLabelsGeneratorMixin()

virtual JKQTPXYLabelsGeneratorMixin::~JKQTPXYLabelsGeneratorMixin ( )
virtual

Member Function Documentation

◆ generateDefaultXLabel()

QString JKQTPXYLabelsGeneratorMixin::generateDefaultXLabel ( double  x,
double  y,
int  index 
) const
protected

default label generator for x-value only

◆ generateDefaultXYLabel()

QString JKQTPXYLabelsGeneratorMixin::generateDefaultXYLabel ( double  x,
double  y,
int  index 
) const
protected

default label generator for x- and y-value

◆ generateDefaultYLabel()

QString JKQTPXYLabelsGeneratorMixin::generateDefaultYLabel ( double  x,
double  y,
int  index 
) const
protected

default label generator for y-value only

◆ getXBelowIsZero()

double JKQTPXYLabelsGeneratorMixin::getXBelowIsZero ( ) const

x-values below this value are treated as exactly 0

◆ getXDateTimeFormat()

QString JKQTPXYLabelsGeneratorMixin::getXDateTimeFormat ( ) const

format string for datetime -> string conversion of x-values

◆ getXDefaultConverter()

JKQTPGraphLabelConverterType JKQTPXYLabelsGeneratorMixin::getXDefaultConverter ( ) const

type of number to string conversion for x-values

◆ getXDefaultPrecision()

int JKQTPXYLabelsGeneratorMixin::getXDefaultPrecision ( ) const

default precision for x-labels

◆ getXMaxNoExponent()

double JKQTPXYLabelsGeneratorMixin::getXMaxNoExponent ( ) const

x-values above this value will be shown in exponent notation, below in decimal notation

◆ getXMinNoExponent()

double JKQTPXYLabelsGeneratorMixin::getXMinNoExponent ( ) const

x-values below this value will be shown in exponent notation, above in decimal notation

◆ getXValueLabelFormat()

QString JKQTPXYLabelsGeneratorMixin::getXValueLabelFormat ( ) const

format string for the x-label, use %1 as placeholder for the numeric value

◆ getXYValueLabelFormat()

QString JKQTPXYLabelsGeneratorMixin::getXYValueLabelFormat ( ) const

format string for the x/y-label, use %1 as placeholder for the numeric value of x and %2 for y

◆ getYBelowIsZero()

double JKQTPXYLabelsGeneratorMixin::getYBelowIsZero ( ) const

y-values below this value are treated as exactly 0

◆ getYDateTimeFormat()

QString JKQTPXYLabelsGeneratorMixin::getYDateTimeFormat ( ) const

format string for datetime -> string conversion of y-value

◆ getYDefaultConverter()

JKQTPGraphLabelConverterType JKQTPXYLabelsGeneratorMixin::getYDefaultConverter ( ) const

type of number to string conversion for y-values

◆ getYDefaultPrecision()

int JKQTPXYLabelsGeneratorMixin::getYDefaultPrecision ( ) const

default precision for x-labels

◆ getYMaxNoExponent()

double JKQTPXYLabelsGeneratorMixin::getYMaxNoExponent ( ) const

y-values above this value will be shown in exponent notation, below in decimal notation

◆ getYMinNoExponent()

double JKQTPXYLabelsGeneratorMixin::getYMinNoExponent ( ) const

y-values below this value will be shown in exponent notation, above in decimal notation

◆ getYValueLabelFormat()

QString JKQTPXYLabelsGeneratorMixin::getYValueLabelFormat ( ) const

format string for the y-label, use %1 as placeholder for the numeric value

◆ setXBelowIsZero()

void JKQTPXYLabelsGeneratorMixin::setXBelowIsZero ( double  v)

x-values below this value are treated as exactly 0

◆ setXDateTimeFormat()

void JKQTPXYLabelsGeneratorMixin::setXDateTimeFormat ( const QString &  v)

format string for datetime -> string conversion of x-values

◆ setXDefaultConverter()

void JKQTPXYLabelsGeneratorMixin::setXDefaultConverter ( JKQTPGraphLabelConverterType  v)

type of number to string conversion for x-values

◆ setXDefaultPrecision()

void JKQTPXYLabelsGeneratorMixin::setXDefaultPrecision ( int  v)

default precision for x-labels

◆ setXMaxNoExponent()

void JKQTPXYLabelsGeneratorMixin::setXMaxNoExponent ( double  v)

x-values above this value will be shown in exponent notation, below in decimal notation

◆ setXMinNoExponent()

void JKQTPXYLabelsGeneratorMixin::setXMinNoExponent ( double  v)

x-values below this value will be shown in exponent notation, above in decimal notation

◆ setXValueLabelFormat()

void JKQTPXYLabelsGeneratorMixin::setXValueLabelFormat ( const QString &  v)

format string for the x-label, use %1 as placeholder for the numeric value

◆ setXYValueLabelFormat()

void JKQTPXYLabelsGeneratorMixin::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

◆ setYBelowIsZero()

void JKQTPXYLabelsGeneratorMixin::setYBelowIsZero ( double  v)

y-values below this value are treated as exactly 0

◆ setYDateTimeFormat()

void JKQTPXYLabelsGeneratorMixin::setYDateTimeFormat ( const QString &  v)

format string for datetime -> string conversion of y-value

◆ setYDefaultConverter()

void JKQTPXYLabelsGeneratorMixin::setYDefaultConverter ( JKQTPGraphLabelConverterType  v)

type of number to string conversion for y-values

◆ setYDefaultPrecision()

void JKQTPXYLabelsGeneratorMixin::setYDefaultPrecision ( int  v)

default precision for x-labels

◆ setYMaxNoExponent()

void JKQTPXYLabelsGeneratorMixin::setYMaxNoExponent ( double  v)

y-values above this value will be shown in exponent notation, below in decimal notation

◆ setYMinNoExponent()

void JKQTPXYLabelsGeneratorMixin::setYMinNoExponent ( double  v)

y-values below this value will be shown in exponent notation, above in decimal notation

◆ setYValueLabelFormat()

void JKQTPXYLabelsGeneratorMixin::setYValueLabelFormat ( const QString &  v)

format string for the y-label, use %1 as placeholder for the numeric value

◆ valToString()

static QString JKQTPXYLabelsGeneratorMixin::valToString ( double  x,
JKQTPGraphLabelConverterType  m_xDefaultConverter,
int  m_xDefaultPrecision,
double  m_xBelowIsZero,
double  m_xMinNoExponent,
double  m_xMaxNoExponent,
const QString &  m_xDateTimeFormat 
)
staticprotected

converts x to a QString, using the provided options

◆ xValToString()

QString JKQTPXYLabelsGeneratorMixin::xValToString ( double  x) const
protected

converts x to a string, using several of the formatting properties set in this class for x-values

◆ yValToString()

QString JKQTPXYLabelsGeneratorMixin::yValToString ( double  y) const
protected

converts y to a string, using several of the formatting properties set in this class for y-values

Member Data Documentation

◆ m_xBelowIsZero

double JKQTPXYLabelsGeneratorMixin::m_xBelowIsZero
private

x-values below this value are treated as exactly 0

◆ m_xDateTimeFormat

QString JKQTPXYLabelsGeneratorMixin::m_xDateTimeFormat
private

format string for datetime -> string conversion of x-values

◆ m_xDefaultConverter

JKQTPGraphLabelConverterType JKQTPXYLabelsGeneratorMixin::m_xDefaultConverter
private

type of number to string conversion for x-values

◆ m_xDefaultPrecision

int JKQTPXYLabelsGeneratorMixin::m_xDefaultPrecision
private

default precision for x-labels

◆ m_xMaxNoExponent

double JKQTPXYLabelsGeneratorMixin::m_xMaxNoExponent
private

x-values above this value will be shown in exponent notation, below in decimal notation

◆ m_xMinNoExponent

double JKQTPXYLabelsGeneratorMixin::m_xMinNoExponent
private

x-values below this value will be shown in exponent notation, above in decimal notation

◆ m_xValueLabelFormat

QString JKQTPXYLabelsGeneratorMixin::m_xValueLabelFormat
private

format string for the x-label, use %1 as placeholder for the numeric value

◆ m_xyValueLabelFormat

QString JKQTPXYLabelsGeneratorMixin::m_xyValueLabelFormat
private

format string for the x/y-label, use %1 as placeholder for the numeric value of x and %2 for y

◆ m_yBelowIsZero

double JKQTPXYLabelsGeneratorMixin::m_yBelowIsZero
private

y-values below this value are treated as exactly 0

◆ m_yDateTimeFormat

QString JKQTPXYLabelsGeneratorMixin::m_yDateTimeFormat
private

format string for datetime -> string conversion of y-value

◆ m_yDefaultConverter

JKQTPGraphLabelConverterType JKQTPXYLabelsGeneratorMixin::m_yDefaultConverter
private

type of number to string conversion for y-values

◆ m_yDefaultPrecision

int JKQTPXYLabelsGeneratorMixin::m_yDefaultPrecision
private

default precision for x-labels

◆ m_yMaxNoExponent

double JKQTPXYLabelsGeneratorMixin::m_yMaxNoExponent
private

y-values above this value will be shown in exponent notation, below in decimal notation

◆ m_yMinNoExponent

double JKQTPXYLabelsGeneratorMixin::m_yMinNoExponent
private

y-values below this value will be shown in exponent notation, above in decimal notation

◆ m_yValueLabelFormat

QString JKQTPXYLabelsGeneratorMixin::m_yValueLabelFormat
private

format string for the y-label, use %1 as placeholder for the numeric value


The documentation for this class was generated from the following file: