20#ifndef jkqtpgraphlabels_H
21#define jkqtpgraphlabels_H
28#include "jkqtplotter/jkqtptools.h"
29#include "jkqtplotter/jkqtplotter_imexport.h"
30#include "jkqtplotter/jkqtpgraphsbase.h"
31#include "jkqtplotter/graphs/jkqtpgraphlabelstylemixin.h"
111 Q_ENUM(LabelContentsDefaultType)
131 virtual
bool getXMinMax(
double& minx,
double& maxx,
double& smallestGreaterZero) override;
133 virtual
bool getYMinMax(
double& miny,
double& maxy,
double& smallestGreaterZero) override;
137 void setColor(QColor c,
bool setTextColor_=true,
bool setFrameColor_=true);
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
this virtual class is the base for any type of coordinate axis, to be drawn by JKQTBasePlotter.
Definition jkqtpcoordinateaxes.h:181
This class manages data columns (with entries of type double ), used by JKQTPlotter/JKQTBasePlotter t...
Definition jkqtpdatastorage.h:282
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
JKQTPGraphValueLabelStyleMixin(JKQTBasePlotter *parent)
class constructor
JKQTBasePlotter * parent
the plotter object this object belongs to
Definition jkqtpgraphsbase.h:386
JKQTPXYGraph(JKQTBasePlotter *parent=nullptr)
class constructor
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
void setDefaultYLabelGenerator()
sets the label geneator function to a default implementation, that prints the y-value only
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
LabelGenerator m_labelGenerator
generate the label for the datapoint at location (x , y ) and being the index -th value in the column...
Definition jkqtpgraphlabels.h:166
JKQTPXYGraphLabels(LabelContentsDefaultType lt, JKQTBasePlotter *parent=nullptr)
class constructor, generates a JKQTPXYGraphLabels with one of the default label generator functors (x...
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
void setDefaultXLabelGenerator()
sets the label geneator function to a default implementation, that prints the x-value only
QString generateLabel(double x, double y, int index) const
generates the label at position (x , y ) and at the given data index
void setCustomLabelGenerator(const LabelGenerator &labgen)
sets a custom label geneator function of type LabelGenerator to use
std::function< QString(double, double, int)> LabelGenerator
type of a functor that generates a label
Definition jkqtpgraphlabels.h:113
void setDefaultXYLabelGenerator()
sets the label geneator function to a default implementation, that prints the x- and y-value
void setColor(QColor c, bool setTextColor_=true, bool setFrameColor_=true)
set color of line and symbol
LabelContentsDefaultType
Definition jkqtpgraphlabels.h:106
@ YValueLabel
generates a label with the y-coordinate only, calls setDefaultYLabelGenerator()
Definition jkqtpgraphlabels.h:108
@ XYValueLabel
generates a label with the x- and y-coordinate, calls setDefaultXYLabelGenerator()
Definition jkqtpgraphlabels.h:109
@ XValueLabel
generates a label with the x-coordinate only, calls setDefaultXLabelGenerator()
Definition jkqtpgraphlabels.h:107
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
JKQTPXYLabelsGeneratorMixin()
class constructor
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:374
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89