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
jkqtpspecialline.h
1/*
2 Copyright (c) 2008-2024 Jan W. Krieger (<jan@jkrieger.de>)
3
4
5
6 This software is free software: you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License (LGPL) as published by
8 the Free Software Foundation, either version 2.1 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU Lesser General Public License (LGPL) for more details.
15
16 You should have received a copy of the GNU Lesser General Public License (LGPL)
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef jkqtpgraphsspecialline_H
21#define jkqtpgraphsspecialline_H
22
23
24#include <QString>
25#include <QPainter>
26#include <QPair>
27#include "jkqtplotter/jkqtptools.h"
28#include "jkqtplotter/jkqtplotter_imexport.h"
29#include "jkqtcommon/jkqtpdrawingtools.h"
30#include "jkqtplotter/jkqtpgraphsbase.h"
31#include "jkqtcommon/jkqtpenhancedpainter.h"
32#include "jkqtplotter/jkqtpgraphsbaseerrors.h"
33#include "jkqtplotter/graphs/jkqtprange.h"
34#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
35
36// forward declarations
37class JKQTBasePlotter;
38class JKQTPlotter;
40class JKQTPDatastore;
41//class JKQTPColorPaletteStyleAndToolsMixin;
42
43
44
45
46/** \brief a Base class for special line graphs (steps ...) like e.g. JKQTPSpecialLineHorizontalGraph
47 * \ingroup jkqtplotter_linesymbolgraphs_line
48 *
49 * \image html stepplots.png
50 *
51 * \see JKQTPSpecialLineHorizontalGraph, JKQTPSpecialLineVerticalGraph
52 */
54 Q_OBJECT
55public:
56 /** \brief class constructor */
57 explicit JKQTPSpecialLineGraphBase(JKQTBasePlotter* parent=nullptr);
58
59 /** \brief returns the color to be used for the key label */
60 virtual QColor getKeyLabelColor() const override;
61 /** \brief plots a key marker inside the specified rectangle \a rect */
62 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
63
64
65 /** \copydoc m_drawSymbols */
66 bool getDrawSymbols() const;
67 /** \copydoc m_specialLineType */
69
70 Q_PROPERTY(bool drawSymbols READ getDrawSymbols WRITE setDrawSymbols)
71 Q_PROPERTY(JKQTPSpecialLineType specialLineType READ getSpecialLineType WRITE setSpecialLineType)
72public Q_SLOTS:
73 /** \brief set line-color, fill color and symbol color */
74 void setColor(QColor c);
75 /** \copydoc m_drawSymbols */
76 void setDrawSymbols(bool __value);
77 /** \copydoc m_specialLineType */
78 void setSpecialLineType(const JKQTPSpecialLineType & __value);
79protected:
80
81 /** \brief indicates whether to draw a symbols at the datapoints, or not */
82 bool m_drawSymbols;
83 /** \brief type of connecting (step)lines */
84 JKQTPSpecialLineType m_specialLineType;
85
86
87};
88
89
90/** \brief This implements a step plot with values \f$ \left(x, f(x) \right) \f$
91 * \ingroup jkqtplotter_linesymbolgraphs_line
92 *
93 * \image html stepplots.png
94 *
95 * \see JKQTPSpecialLineVerticalGraph, \ref JKQTPlotterSpecialStepLinePlot
96 */
98 Q_OBJECT
99public:
100 /** \brief class constructor */
102 /** \brief class constructor */
104
105 /** \brief plots the graph to the plotter object specified as parent */
106 virtual void draw(JKQTPEnhancedPainter& painter) override;
107
108protected:
109
110};
111
112
113
114/*! \brief This implements a step plot with values \f$ \left(f(y), y \right) \f$
115 \ingroup jkqtplotter_linesymbolgraphs_line
116
117 \image html stepplots_vertical.png
118
119 \see JKQTPSpecialLineHorizontalGraph, \ref JKQTPlotterSpecialStepLinePlot
120 */
122 Q_OBJECT
123 public:
124 /** \brief class constructor */
126 /** \brief class constructor */
128
129 /** \brief plots the graph to the plotter object specified as parent */
130 virtual void draw(JKQTPEnhancedPainter& painter) override;
131 /** \brief returns the column used as "key" for the current graph (typically this call getXColumn(), but for horizontal graphs like filled curves or barcharts it may call getYColumn() ) */
132 virtual int getKeyColumn() const override;
133 /** \brief returns the column used as "value" for the current graph (typically this call getXColumn(), but for horizontal graphs like filled curves or barcharts it may call getYColumn() ) */
134 virtual int getValueColumn() const override;
135 public Q_SLOTS:
136 /** \brief sets the column used as "key" for the current graph (typically this call setXColumn(), but for horizontal graphs like filled curves or barcharts it may call setYColumn() ) */
137 virtual void setKeyColumn(int __value) override;
138 /** \brief sets the column used as "value" for the current graph (typically this call setXColumn(), but for horizontal graphs like filled curves or barcharts it may call setYColumn() ) */
139 virtual void setValueColumn(int __value) override;
140};
141
142
143
144
145#endif // jkqtpgraphsspecialline_H
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
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line and...
Definition jkqtpgraphsbasestylingmixins.h:595
This Mix-In class provides setter/getter methods, storage and other facilities for a line-graph compr...
Definition jkqtpgraphsbasestylingmixins.h:175
This Mix-In class provides setter/getter methods, storage and other facilities for the graph symbols ...
Definition jkqtpgraphsbasestylingmixins.h:379
a Base class for special line graphs (steps ...) like e.g. JKQTPSpecialLineHorizontalGraph
Definition jkqtpspecialline.h:53
JKQTPSpecialLineType getSpecialLineType() const
type of connecting (step)lines
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
bool getDrawSymbols() const
indicates whether to draw a symbols at the datapoints, or not
JKQTPSpecialLineGraphBase(JKQTBasePlotter *parent=nullptr)
class constructor
virtual void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
This implements a step plot with values .
Definition jkqtpspecialline.h:97
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
JKQTPSpecialLineHorizontalGraph(JKQTBasePlotter *parent=nullptr)
class constructor
JKQTPSpecialLineHorizontalGraph(JKQTPlotter *parent)
class constructor
This implements a step plot with values .
Definition jkqtpspecialline.h:121
virtual int getKeyColumn() const override
returns the column used as "key" for the current graph (typically this call getXColumn(),...
virtual int getValueColumn() const override
returns the column used as "value" for the current graph (typically this call getXColumn(),...
virtual void setKeyColumn(int __value) override
sets the column used as "key" for the current graph (typically this call setXColumn(),...
virtual void setValueColumn(int __value) override
sets the column used as "value" for the current graph (typically this call setXColumn(),...
JKQTPSpecialLineVerticalGraph(JKQTBasePlotter *parent=nullptr)
class constructor
JKQTPSpecialLineVerticalGraph(JKQTPlotter *parent)
class constructor
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
This virtual JKQTPGraph descendent extends JKQTPXYGraph adds a baseline-property, which is necessary,...
Definition jkqtpgraphsbase.h:712
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:364
JKQTPSpecialLineType
plot styles for the error information
Definition jkqtptools.h:750
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89