21#ifndef JKQTPGRAPHSBASE_H
22#define JKQTPGRAPHSBASE_H
27#include "jkqtplotter/jkqtpbaseelements.h"
28#include "jkqtplotter/jkqtpbaseplotter.h"
29#include "jkqtplotter/jkqtptools.h"
30#include "jkqtplotter/jkqtplotter_imexport.h"
31#include "jkqtplotter/jkqtpimagetools.h"
90 virtual bool getXMinMax(
double& minx,
double& maxx,
double& smallestGreaterZero)=0;
100 virtual bool getYMinMax(
double& miny,
double& maxy,
double& smallestGreaterZero)=0;
465 bool getDataMinMax(
int column,
double& minx,
double& maxx,
double& smallestGreaterZero);
600 Q_ENUM(DataSortOrder)
607 virtual
bool getXMinMax(
double& minx,
double& maxx,
double& smallestGreaterZero) override;
609 virtual
bool getYMinMax(
double& miny,
double& maxy,
double& smallestGreaterZero) override;
639 virtual
double hitTest(const QPointF &posSystem, QPointF* closestSpotSystem=
nullptr, QString* label=
nullptr,
HitTestMode mode=
HitTestXY) const override;
645#if QT_VERSION<QT_VERSION_CHECK(6,0,0)
731 bool getMinMaxWithErrorsAndBaseline(
int dataColumn,
int errorColumn,
int errorColumnLower,
bool errorSymmetric,
double &minv,
double &maxv,
double &smallestGreaterZero);
763 virtual bool getYMinMax(
double& miny,
double& maxy,
double& smallestGreaterZero)
override;
774 virtual double hitTest(
const QPointF &posSystem, QPointF* closestSpotSystem=
nullptr, QString* label=
nullptr,
HitTestMode mode=
HitTestXY)
const override;
821 virtual bool getXMinMax(
double& minx,
double& maxx,
double& smallestGreaterZero)
override;
832 virtual double hitTest(
const QPointF &posSystem, QPointF* closestSpotSystem=
nullptr, QString* label=
nullptr,
HitTestMode mode=
HitTestXY)
const override;
888 Q_ENUM(DataSortOrder)
895 Q_ENUM(DataDirection)
978 Q_ENUM(VectorDataLayout)
985 virtual
bool getXMinMax(
double& minx,
double& maxx,
double& smallestGreaterZero) override;
987 virtual
bool getYMinMax(
double& miny,
double& maxy,
double& smallestGreaterZero) override;
1004 virtual
double hitTest(const QPointF &posSystem, QPointF* closestSpotSystem=
nullptr, QString* label=
nullptr,
HitTestMode mode=
HitTestXY) const override;
1042 double colValue=atan2(v.y(),v.x());
1132 Q_ENUM(DataSortOrder)
1139 virtual
bool getXMinMax(
double& minx,
double& maxx,
double& smallestGreaterZero) override;
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
DrawMode
indicates how to draw the geometric object
Definition jkqtpgraphsbase.h:496
@ DrawAsMathematicalCurve
draw lines as the mathematically correct curve
Definition jkqtpgraphsbase.h:498
@ DrawAsGraphicElement
draw lines as lines (i.e. graphic elements)
Definition jkqtpgraphsbase.h:497
DrawMode drawMode
Definition jkqtpgraphsbase.h:514
void setDrawMode(DrawMode mode)
indicated whether to draw lines as graphic elements (even on non-linear coordinate systems),...
JKQTPGeometricPlotElement(DrawMode drawMode=DrawAsGraphicElement, JKQTBasePlotter *parent=nullptr)
class constructor
DrawMode m_drawMode
indicated whether to draw lines as graphic elements (even on non-linear coordinate systems),...
Definition jkqtpgraphsbase.h:539
DrawMode getDrawMode() const
indicated whether to draw lines as graphic elements (even on non-linear coordinate systems),...
This mix-in class assembles all styling properties applicable to error indicators.
Definition jkqtpgraphsbaseerrors.h:45
virtual bool usesColumn(int column) const
returns true if the given column is used by the graph
friend class JKQTPGraphErrorStyleMixin
Definition jkqtpgraphsbase.h:472
virtual ~JKQTPGraph()=default
default wirtual destructor
virtual void drawErrorsBefore(JKQTPEnhancedPainter &)
this function is used to plot error inidcators before plotting the graphs.
bool getDataMinMax(int column, double &minx, double &maxx, double &smallestGreaterZero)
get the maximum and minimum value of the given column
JKQTPGraph(JKQTBasePlotter *parent=nullptr)
class constructor
virtual void drawErrorsAfter(JKQTPEnhancedPainter &)
this function is used to plot error inidcators after plotting the graphs.
virtual ~JKQTPPlotAnnotationElement()
default wirtual destructor
JKQTPPlotAnnotationElement(JKQTBasePlotter *parent=nullptr)
class constructor
virtual void setTitle(const QString &__value)
sets the title of the plot (for display in key!).
void addHitTestData(const QPointF &pos_, int index_=-1, const JKQTPDatastore *datastore=nullptr)
clear the internal datastore for hitTest(), this variant uses formatHitTestDefaultLabel() to auto-gen...
Definition jkqtpgraphsbase.h:350
QPointF backTransform(const QPointF &x) const
tool routine that back-transforms a QPointF according to the parent's transformation rules (pixels --...
Definition jkqtpgraphsbase.h:241
int parentPlotStyle
internal storage for the used parent plot style
Definition jkqtpgraphsbase.h:396
QString yFloatToString(double v, int past_comma=-1) const
converts a x-value v into a string, taking into account the type of x-axis
void reserveHitTestData(int points)
reserve list entries for up to points graph points in the internal datastore for hitTest()
Definition jkqtpgraphsbase.h:306
double transformX(double x) const
tool routine that transforms an x-coordinate (plot coordinate --> pixels) for this plot element,...
virtual double hitTest(const QPointF &posSystem, QPointF *closestSpotSystem=nullptr, QString *label=nullptr, HitTestMode mode=HitTestXY) const
returns the closest distance of the plot element to the (screen pixel) position pos,...
void setVisible(bool __value)
sets whether the graph is visible in the plot
bool visible
indicates whether the graph is visible in the plot
Definition jkqtpgraphsbase.h:120
void setYAxis(JKQTPCoordinateAxisRef ref)
indicates which coordinate axis to use for coordinate transforms in y-direction
JKQTBasePlotter * getParent()
returns the parent painter class
Definition jkqtpgraphsbase.h:114
const JKQTPCoordinateAxis * getYAxis() const
returns the actual y-Axis-object from the parent plotter, referenced in yAxisRef
Definition jkqtpgraphsbase.h:281
QPointF backTransform(double x, double y) const
tool routine that back-transforms a QPointF according to the parent's transformation rules (pixels --...
Definition jkqtpgraphsbase.h:251
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect)=0
plots a key marker inside the specified rectangle rect
JKQTPCoordinateAxisRef yAxisRef
indicates which coordinate axis to use for coordinate transforms in y-direction
Definition jkqtpgraphsbase.h:291
QPainterPath transformToLinePath(const QPolygonF &x) const
tool routine that transforms a QPolygonF according to the parent's transformation rules and returns a...
virtual void setParent(JKQTPlotter *parent)
sets the parent painter class
virtual void draw(JKQTPEnhancedPainter &painter)=0
plots the graph to the plotter object specified as parent
QVector< double > transformY(const QVector< double > &x) const
transform all y-coordinates in a vector x
virtual QString formatHitTestDefaultLabel(double x, double y, int index=-1, const JKQTPDatastore *datastore=nullptr) const
tool-function for hitTest(), which formats a default label, taking into account the x- and y-position...
void addHitTestData(double x_, double y_, const QString &label_)
add a new point on the graph to the internal datastore for hitTest()
Definition jkqtpgraphsbase.h:321
QPointF transform(const QPointF &x) const
tool routine that transforms a QPointF according to the parent's transformation rules (plot coordinat...
Definition jkqtpgraphsbase.h:235
void setXAxis(JKQTPCoordinateAxisRef ref)
indicates which coordinate axis to use for coordinate transforms in x-direction
bool highlighted
indicates whether the graph is shown in a "highlghted" in the plot
Definition jkqtpgraphsbase.h:122
QString getTitle() const
returns the the title of the plot
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero)=0
get the maximum and minimum x-value of the graph
void clearHitTestData()
clear the internal datastore for hitTest()
Definition jkqtpgraphsbase.h:300
void addHitTestData(const QPointF &pos_, int index_, const QString &label_)
clear the internal datastore for hitTest()
Definition jkqtpgraphsbase.h:369
void addHitTestData(double x_, double y_, int index_, const QString &label_)
clear the internal datastore for hitTest()
Definition jkqtpgraphsbase.h:360
void setAxes(JKQTPCoordinateAxisRef ref)
set the coordinate axes to use for this plot element
virtual QColor getKeyLabelColor() const =0
returns the color to be used for the key label
virtual void drawOutside(JKQTPEnhancedPainter &painter, QRect leftSpace, QRect rightSpace, QRect topSpace, QRect bottomSpace)
plots outside the actual plot field of view (e.g. color bars, scale bars, ...)
JKQTBasePlotter * parent
the plotter object this object belongs to
Definition jkqtpgraphsbase.h:386
QImage generateKeyMarker(QSize size=QSize(16, 16))
returns an image with a key marker inside
const JKQTPCoordinateAxis * getXAxis() const
returns the actual x-Axis-object from the parent plotter, referenced in xAxisRef
Definition jkqtpgraphsbase.h:277
bool isHighlighted() const
returns whether the graph is shown in a highlighted style in the plot
void addHitTestData(double x_, double y_, int index_=-1, const JKQTPDatastore *datastore=nullptr)
add a new point on the graph to the internal datastore for hitTest(), this variant uses formatHitTest...
Definition jkqtpgraphsbase.h:340
void addHitTestData(const QPointF &pos_, const QString &label_)
clear the internal datastore for hitTest()
Definition jkqtpgraphsbase.h:329
const JKQTBasePlotter * getParent() const
returns the parent painter class
Definition jkqtpgraphsbase.h:112
QVector< HitTestLocation > m_hitTestData
dataset with graph-points and associated data from the function hitTest()
Definition jkqtpgraphsbase.h:407
double backtransformY(double y) const
tool routine that backtransforms a y-coordinate (pixels --> plot coordinate) for this plot element,...
virtual void getOutsideSize(JKQTPEnhancedPainter &painter, int &leftSpace, int &rightSpace, int &topSpace, int &bottomSpace)
if the graph plots outside the actual plot field of view (e.g. color bars, scale bars,...
double transformY(double y) const
tool routine that transforms a y-coordinate (plot coordinate --> pixels) for this plot element,...
QString title
title of the plot (for display in key!). If no title is supplied, no key entry is drawn.
Definition jkqtpgraphsbase.h:121
virtual ~JKQTPPlotElement()=default
default wirtual destructor
QPolygonF transform(const QPolygonF &x) const
tool routine that transforms a QPolygonF according to the parent's transformation rules (plot coordin...
QPointF transform(double x, double y) const
tool routine that transforms a QPointF according to the parent's transformation rules (plot coordinat...
Definition jkqtpgraphsbase.h:246
QVector< double > transformX(const QVector< double > &x) const
transform all x-coordinates in a vector x
JKQTPCoordinateAxisRef xAxisRef
indicates which coordinate axis to use for coordinate transforms in x-direction
Definition jkqtpgraphsbase.h:290
void addHitTestData(const HitTestLocation &loc)
clear the internal datastore for hitTest()
Definition jkqtpgraphsbase.h:312
bool isVisible() const
returns whether the graph is visible in the plot
HitTestMode
modes of operation for the function hitTest()
Definition jkqtpgraphsbase.h:151
@ HitTestXOnly
find closest point in x-direction only
Definition jkqtpgraphsbase.h:153
@ HitTestXY
find closest point in x- and y-direction simulatneously (i.e. measure direct distance)
Definition jkqtpgraphsbase.h:152
@ HitTestYOnly
find closest point in y-direction only
Definition jkqtpgraphsbase.h:154
void setHighlighted(bool __value)
sets whether the graph is drawn in a highlighted style in the plot
JKQTPCoordinateAxisRef getXAxisRef() const
indicates which coordinate axis to use for coordinate transforms in x-direction
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero)=0
get the maximum and minimum y-value of the graph
JKQTPPlotElement(JKQTBasePlotter *parent=nullptr)
class constructor
virtual void setParent(JKQTBasePlotter *parent)
sets the parent painter class
QString xFloatToString(double v, int past_comma=-1) const
converts a x-value v into a string, taking into account the type of x-axis
double backtransformX(double x) const
tool routine that backtransforms an x-coordinate (pixels --> plot coordinate) for this plot element,...
JKQTPCoordinateAxisRef getYAxisRef() const
indicates which coordinate axis to use for coordinate transforms in y-direction
int getDataColumn() const
the column that contains the datapoints
void setDataSortOrder(int __value)
if !=Unsorted, the data is sorted before plotting
DataSortOrder getDataSortOrder() const
if !=Unsorted, the data is sorted before plotting
DataSortOrder sortData
if !=Unsorted, the data is sorted before plotting
Definition jkqtpgraphsbase.h:913
virtual bool getIndexRange(int &imin, int &imax) const
determines the range of row indexes available in the data columns of this graph
JKQTPSingleColumnGraph(JKQTBasePlotter *parent=nullptr)
class constructor
void setDataColumn(int __value)
the column that contains the datapoints
virtual void intSortData()
int getDataIndex(int i) const
returns the index of the i-th datapoint (where i is an index into the SORTED datapoints)
Definition jkqtpgraphsbase.h:946
DataSortOrder
specifies how to sort the data for a JKQTPSingleColumnGraph before drawing
Definition jkqtpgraphsbase.h:884
@ Unsorted
the data for a JKQTPSingleColumnGraph is not sorted before drawing
Definition jkqtpgraphsbase.h:885
@ Sorted
the data for a JKQTPSingleColumnGraph is sorted (in ascending order) before drawing
Definition jkqtpgraphsbase.h:886
DataDirection
specifies whether the data for a JKQTPSingleColumnGraph represent x-axis or y-axis values
Definition jkqtpgraphsbase.h:891
@ X
the data for a JKQTPSingleColumnGraph is data belonging to the x-axis of the plot
Definition jkqtpgraphsbase.h:892
@ Y
the data for a JKQTPSingleColumnGraph is data belonging to the y-axis of the plot
Definition jkqtpgraphsbase.h:893
virtual bool usesColumn(int c) const override
returns true if the given column is used by the graph
int dataColumn
the column that contains the datapoints
Definition jkqtpgraphsbase.h:914
QVector< int > sortedIndices
this array contains the order of indices, in which to access the data in the data columns
Definition jkqtpgraphsbase.h:939
DataDirection dataDirection
interpret the data from dataColumn either as X- or Y-data
Definition jkqtpgraphsbase.h:915
void setDataDirection(DataDirection __value)
interpret the data from dataColumn either as X- or Y-data
DataDirection getDataDirection() const
interpret the data from dataColumn either as X- or Y-data
DataSortOrder
specifies how to sort the data in a JKQTPXGraph before drawing
Definition jkqtpgraphsbase.h:1128
@ SortedX
the data for a JKQTPXYGraph is sorted so the x-values appear in ascending before drawing
Definition jkqtpgraphsbase.h:1130
@ Unsorted
the data for a JKQTPXYGraph is not sorted before drawing
Definition jkqtpgraphsbase.h:1129
void setDataSortOrder(int __value)
if !=Unsorted, the data is sorted before plotting
int getDataIndex(int i) const
returns the index of the i-th datapoint (where i is an index into the SORTED datapoints)
Definition jkqtpgraphsbase.h:1184
QVector< int > sortedIndices
this array contains the order of indices, in which to access the data in the data columns
Definition jkqtpgraphsbase.h:1174
virtual bool usesColumn(int column) const override
returns true if the given column is used by the graph
JKQTPXGraph(JKQTBasePlotter *parent=nullptr)
class constructor
DataSortOrder getDataSortOrder() const
if !=Unsorted, the data is sorted before plotting
int xColumn
the column that contains the x-component of the datapoints
Definition jkqtpgraphsbase.h:1152
virtual bool getIndexRange(int &imin, int &imax) const
determines the range of row indexes available in the data columns of this graph
void setXColumn(int __value)
the column that contains the x-component of the datapoints
virtual void setKeyColumn(int __value)
sets the column used as "key" for the current graph (typically this call setXColumn(),...
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
DataSortOrder sortData
if !=Unsorted, the data is sorted before plotting
Definition jkqtpgraphsbase.h:1151
virtual void intSortData()
sorts data according to the specified criterion in sortData ... The result is stored as a index-map i...
int getXColumn() const
the column that contains the x-component of the datapoints
virtual int getKeyColumn() const
returns the column used as "key" for the current graph (typically this call getXColumn(),...
virtual int getKey2Column() const
returns the column used as "key" for the current graph (typically this call getXColumn(),...
void setXColumn2(int __value)
the column that contains the second y-component of the datapoints
virtual bool getIndexRange(int &imin, int &imax) const override
determines the range of row indexes available in the data columns of this graph
int xColumn2
the column that contains the second y-component of the datapoints
Definition jkqtpgraphsbase.h:834
int getXColumn2() const
the column that contains the second y-component of the datapoints
virtual void setKey2Column(int __value)
sets the column used as "key" for the current graph (typically this call setXColumn(),...
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
void setXXYColumns(size_t xCol, size_t x2Col, size_t yCol)
sets xColumn, yColumn and xColumn2 at the same time
void setXColumn2(size_t __value)
the column that contains the second y-component of the datapoints
virtual double hitTest(const QPointF &posSystem, QPointF *closestSpotSystem=nullptr, QString *label=nullptr, HitTestMode mode=HitTestXY) const override
Implmentation of JKQTPPlotElement::hitTest(), which searches through all graph points defined by xCol...
JKQTPXXYGraph(JKQTBasePlotter *parent=nullptr)
class constructor
virtual bool usesColumn(int column) const override
returns true if the given column is used by the graph
void setXXYColumns(int xCol, int x2Col, int yCol)
sets xColumn, yColumn and xColumn2 at the same time
double getVectorAngle(int i) const
Definition jkqtpgraphsbase.h:1046
int angleColumn
the column that contains the rotation angle [in radian]
Definition jkqtpgraphsbase.h:1011
VectorDataLayout vectorDataLayout
indicates, which column pairs to use (dxColumn, dyColumn), (angleColumn, lengthColumn),...
Definition jkqtpgraphsbase.h:1008
void setLengthColumn(int col)
the column that contains the vector length
virtual double hitTest(const QPointF &posSystem, QPointF *closestSpotSystem=nullptr, QString *label=nullptr, HitTestMode mode=HitTestXY) const override
Implmentation of JKQTPPlotElement::hitTest(), which searches through all graph points defined by xCol...
static double getVectorAngle(const QPointF &v)
calculates the rotation angle (3 o'clock is 0) in radians of a vector v
Definition jkqtpgraphsbase.h:1041
int getLengthColumn() const
the column that contains the vector length
int getAngleColumn() const
the column that contains the rotation angle [in radian]
int getDyColumn() const
the column that contains the delta along the y-axis.
VectorDataLayout
values from this enum indicates how to interpret the data columns provided to this graph
Definition jkqtpgraphsbase.h:972
@ AngleAndLengthLayout
Data is given in the form of an angle and a length that describe the vector together.
Definition jkqtpgraphsbase.h:974
@ DefaultVectorDataLayout
Definition jkqtpgraphsbase.h:976
@ DeltaXDeltaYLayout
Data is given in the form of two vector components (along x- and y-axis)
Definition jkqtpgraphsbase.h:973
int lengthColumn
the column that contains the vector length
Definition jkqtpgraphsbase.h:1012
void setAngleColumn(int col)
the column that contains the rotation angle [in radian]
int dyColumn
the column that contains the delta along the y-axis.
Definition jkqtpgraphsbase.h:1010
virtual bool getIndexRange(int &imin, int &imax) const override
determines the range of row indexes available in the data columns of this graph
virtual bool usesColumn(int column) const override
returns true if the given column is used by the graph
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
static double getVectorMagnitude(const QPointF &v)
calculates the magnitude/length of a vector v
Definition jkqtpgraphsbase.h:1034
QPointF getVectorDxDy(int i) const
this function interprets vectorDataLayout together with (dxColumn, dyColumn) or (angleColumn,...
JKQTPXYAndVectorGraph(JKQTBasePlotter *parent=nullptr)
class constructor
double getVectorMagnitude(int i) const
Definition jkqtpgraphsbase.h:1037
void setAngleAndLengthColumn(int colAngle, int colLength)
det angleColumn and lengthColumn column at the same time! ALso ensures that vectorDataLayout is set a...
VectorDataLayout getVectorDataLayout() const
indicates, which column pairs to use (dxColumn, dyColumn), (angleColumn, lengthColumn),...
void setDyColumn(int col)
the column that contains the delta along the y-axis.
void setDxDyColumn(int colDx, int colDy)
det dxColumn and dyColumn column at the same time! ALso ensures that vectorDataLayout is set accordin...
int getDxColumn() const
the column that contains the delta along the x-axis.
void setDxColumn(int col)
the column that contains the delta along the x-axis.
int dxColumn
the column that contains the delta along the x-axis.
Definition jkqtpgraphsbase.h:1009
virtual QString formatHitTestDefaultLabel(double x, double y, int index=-1, const JKQTPDatastore *datastore=nullptr) const override
tool-function for hitTest(), which formats a default label, taking into account the x- and y-position...
double baseline
Definition jkqtpgraphsbase.h:722
bool getMinMaxWithErrorsAndBaseline(int dataColumn, int errorColumn, int errorColumnLower, bool errorSymmetric, double &minv, double &maxv, double &smallestGreaterZero)
can be called by JKQTPGraph::getXMinMax() or JKQTPGraph::getYMinMax() calculates min/max/....
double getBaseline() const
baseline of the plot (NOTE: 0 is interpreted as until plot border in log-mode!!!)
double getErrorU(int i, const JKQTPDatastore *ds, int xErrorColumn) const
returns the upper error for the i-th datapoint, read from datastore ds
void setBaseline(double __value)
baseline of the plot (NOTE: 0 is interpreted as until plot border in log-mode!!!)
double getErrorL(int i, const JKQTPDatastore *ds, int xErrorColumn, int xErrorColumnLower, bool xErrorSymmetric) const
returns the lower error for the i-th datapoint, read from datastore ds
JKQTPXYBaselineGraph(JKQTBasePlotter *parent=nullptr)
class constructor
double m_baseline
baseline of the plot (NOTE: 0 is interpreted as until plot border in log-mode!!!)
Definition jkqtpgraphsbase.h:738
bool getMinMaxWithBaseline(int dataColumn, double &minv, double &maxv, double &smallestGreaterZero)
can be called by JKQTPGraph::getXMinMax() or JKQTPGraph::getYMinMax() calculates min/max/....
DataSortOrder getDataSortOrder() const
if !=Unsorted, the data is sorted before plotting
virtual void intSortData()
sorts data according to the specified criterion in sortData ... The result is stored as a index-map i...
void setXColumn(size_t __value)
the column that contains the x-component of the datapoints
virtual bool getXMinMax(double &minx, double &maxx, double &smallestGreaterZero) override
get the maximum and minimum x-value of the graph
void setXYColumns(QPair< size_t, size_t > xyColPair)
sets xColumn and yColumn at the same time
void setDataSortOrder(int __value)
if !=Unsorted, the data is sorted before plotting
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
QVector< int > sortedIndices
this array contains the order of indices, in which to access the data in the data columns
Definition jkqtpgraphsbase.h:681
void setYColumn(int __value)
the column that contains the y-component of the datapoints
void setXColumn(int __value)
the column that contains the x-component of the datapoints
int xColumn
the column that contains the x-component of the datapoints
Definition jkqtpgraphsbase.h:626
JKQTPXYGraph(JKQTBasePlotter *parent=nullptr)
class constructor
int getXColumn() const
the column that contains the x-component of the datapoints
virtual int getKeyColumn() const
returns the column used as "key" for the current graph (typically this call getXColumn(),...
int getDataIndex(int i) const
returns the index of the i-th datapoint (where i is an index into the SORTED datapoints)
Definition jkqtpgraphsbase.h:691
virtual double hitTest(const QPointF &posSystem, QPointF *closestSpotSystem=nullptr, QString *label=nullptr, HitTestMode mode=HitTestXY) const override
Implmentation of JKQTPPlotElement::hitTest(), which searches through all graph points defined by xCol...
void setXYColumns(size_t xCol, size_t yCol)
sets xColumn and yColumn at the same time
int getYColumn() const
the column that contains the y-component of the datapoints
void setDataSortOrder(DataSortOrder __value)
if !=Unsorted, the data is sorted before plotting
DataSortOrder sortData
if !=Unsorted, the data is sorted before plotting
Definition jkqtpgraphsbase.h:625
DataSortOrder
specifies how to sort the data in a JKQTPXYGraph before drawing
Definition jkqtpgraphsbase.h:595
@ SortedY
the data for a JKQTPXYGraph is sorted so the y-values appear in ascending before drawing
Definition jkqtpgraphsbase.h:598
@ SortedX
the data for a JKQTPXYGraph is sorted so the x-values appear in ascending before drawing
Definition jkqtpgraphsbase.h:597
@ Unsorted
the data for a JKQTPXYGraph is not sorted before drawing
Definition jkqtpgraphsbase.h:596
virtual bool usesColumn(int column) const override
returns true if the given column is used by the graph
virtual bool getIndexRange(int &imin, int &imax) const
determines the range of row indexes available in the data columns of this graph
int yColumn
the column that contains the y-component of the datapoints
Definition jkqtpgraphsbase.h:627
virtual int getValueColumn() const
returns the column used as "value" for the current graph (typically this call getXColumn(),...
virtual void setValueColumn(int __value)
sets the column used as "value" for the current graph (typically this call setXColumn(),...
virtual void setKeyColumn(int __value)
sets the column used as "key" for the current graph (typically this call setXColumn(),...
void setYColumn(size_t __value)
the column that contains the y-component of the datapoints
void setXYColumns(QPair< int, int > xyColPair)
sets xColumn and yColumn at the same time
void setXYYColumns(size_t xCol, size_t yCol, size_t y2Col)
sets xColumn, yColumn and yColumn2 at the same time
void setYColumn2(size_t __value)
the column that contains the second y-component of the datapoints
virtual int getValue2Column() const
returns the column used as secondary "value" for the current graph (typically this call getXColumn(),...
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
virtual bool getIndexRange(int &imin, int &imax) const override
determines the range of row indexes available in the data columns of this graph
void setXYYColumns(int xCol, int yCol, int y2Col)
sets xColumn, yColumn and yColumn2 at the same time
int yColumn2
the column that contains the second y-component of the datapoints
Definition jkqtpgraphsbase.h:776
int getYColumn2() const
the column that contains the second y-component of the datapoints
virtual double hitTest(const QPointF &posSystem, QPointF *closestSpotSystem=nullptr, QString *label=nullptr, HitTestMode mode=HitTestXY) const override
Implmentation of JKQTPPlotElement::hitTest(), which searches through all graph points defined by xCol...
virtual void setValue2Column(int __value)
sets the column used as secondary "value" for the current graph (typically this call setXColumn(),...
virtual bool usesColumn(int column) const override
returns true if the given column is used by the graph
void setYColumn2(int __value)
the column that contains the second y-component of the datapoints
JKQTPXYYGraph(JKQTBasePlotter *parent=nullptr)
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
JKQTPCoordinateAxes JKQTPCoordinateAxisRef
type for indexing coordinate axes in a plot
Definition jkqtpcoordinateaxes.h:50
Dataset for a single point on the graph, associated with its data-column index and a label that can b...
Definition jkqtpgraphsbase.h:205
QPointF pos
position of the hit-test point
Definition jkqtpgraphsbase.h:212
HitTestLocation(double x_, double y_, const QString &label_)
Definition jkqtpgraphsbase.h:207
int index
index of the hit-test point in the linked data-columns (or -1)
Definition jkqtpgraphsbase.h:214
QString label
label for that specific hit-test point
Definition jkqtpgraphsbase.h:216
HitTestLocation(const QPointF &pos_, int index_, const QString &label_)
Definition jkqtpgraphsbase.h:210
HitTestLocation(double x_, double y_, int index_, const QString &label_)
Definition jkqtpgraphsbase.h:209
HitTestLocation()
Definition jkqtpgraphsbase.h:206
HitTestLocation(const QPointF &pos_, const QString &label_)
Definition jkqtpgraphsbase.h:208