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
jkqtplines.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 JKQTPLINES_H
21#define JKQTPLINES_H
22
23
24#include <QString>
25#include <QPainter>
26#include <QPair>
27#include <functional>
28#include "jkqtplotter/jkqtptools.h"
29#include "jkqtplotter/jkqtplotter_imexport.h"
30#include "jkqtcommon/jkqtpdrawingtools.h"
31#include "jkqtplotter/jkqtpgraphsbase.h"
32#include "jkqtcommon/jkqtpenhancedpainter.h"
33#include "jkqtplotter/jkqtpgraphsbaseerrors.h"
34#include "jkqtplotter/graphs/jkqtprange.h"
35#include "jkqtplotter/jkqtpgraphsbasestylingmixins.h"
36
37// forward declarations
38class JKQTBasePlotter;
39class JKQTPlotter;
41class JKQTPDatastore;
42//class JKQTPColorPaletteStyleAndToolsMixin;
43
44
45
46
47
48
49/*! \brief This implements xy line plots. This also alows to draw symbols at the data points.
50 \ingroup jkqtplotter_linesymbolgraphs_line
51
52 \image html JKQTPXYLineGraph.png
53
54 \note This classes can (and does by default) apply a line-compression strategy that improves plotting speed
55 but reduces accuracy a bit. See JKQTPGraphLinesCompressionMixin for details.
56
57 \see \ref JKQTPlotterAdvancedLineAndFillStyling, \ref JKQTPlotterSimpleTest, \ref JKQTPlotterSymbolsAndStyles,
58 jkqtpstatAddVKDE1D(), jkqtpstatAddVKDE1DAutoranged(), jkqtpstatAddHKDE1D(), jkqtpstatAddHKDE1DAutoranged(),
59 JKQTPGraphLinesCompressionMixin
60 */
62 Q_OBJECT
63 public:
64 /** \brief class constructor */
66 /** \brief class constructor */
69
70 /** \brief plots the graph to the plotter object specified as parent */
71 virtual void draw(JKQTPEnhancedPainter& painter) override;
72 /** \brief plots a key marker inside the specified rectangle \a rect */
73 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
74 /** \brief returns the color to be used for the key label */
75 virtual QColor getKeyLabelColor() const override;
76
77 /** \copydoc drawLine */
78 void setDrawLine(bool __value);
79 /** \copydoc drawLine */
80 bool getDrawLine() const;
81 /** \copydoc drawLineInForeground */
82 void setDrawLineInForeground(bool __value);
83 /** \copydoc drawLineInForeground */
85
86 /** \brief set color of line and symbol */
87 void setColor(QColor c);
88
89 protected:
90
91 /** \brief indicates whether to draw a line or not */
93 /** \brief indicates whether to draw the line behind or above the symbols */
95
96
97};
98
99
100
101
102
103
104/*! \brief This implements xy line plots with x and y error indicators.
105 \ingroup jkqtplotter_linesymbolgraphs_line
106
107 \image html JKQTPXYLineErrorGraph_JKQTPErrorBars.png "setYErrorStyle(JKQTPErrorBars)"
108 \image html JKQTPXYLineErrorGraph_JKQTPErrorLines.png "setYErrorStyle(JKQTPErrorLines)"
109 \image html JKQTPXYLineErrorGraph_JKQTPErrorPolygons.png "setYErrorStyle(JKQTPErrorPolygins;"
110
111 \see jkqtpstatAddXYErrorLineGraph(), jkqtpstatAddXErrorLineGraph(), jkqtpstatAddYErrorLineGraph(), \ref JKQTPlotterErrorBarStyles, \ref JKQTPlotterBasicJKQTPDatastoreStatisticsGroupedStat
112 */
114 Q_OBJECT
115 public:
116 /** \brief class constructor */
118 /** \brief class constructor */
120
121 /** \copydoc JKQTPPlotElement::getXMinMax() */
122 virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
123 /** \copydoc JKQTPPlotElement::getYMinMax() */
124 virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
125 /** \copydoc JKQTPGraph::usesColumn() */
126 virtual bool usesColumn(int c) const override;
127
128 protected:
129 /** \brief this function is used to plot error inidcators before plotting the graphs. */
130 virtual void drawErrorsBefore(JKQTPEnhancedPainter& painter) override;
131};
132
133
134
135
136
137
138#endif // JKQTPLINES_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
JKQTPGraphLineStyleMixin()
class constructor
JKQTPGraphLinesCompressionMixin()
class constructor
JKQTPGraphSymbolStyleMixin()
class constructor
JKQTBasePlotter * parent
the plotter object this object belongs to
Definition jkqtpgraphsbase.h:386
JKQTPXYGraphErrors()
class contructor
JKQTPXYGraph(JKQTBasePlotter *parent=nullptr)
class constructor
virtual bool usesColumn(int c) const override
returns true if the given column is used by the graph
virtual bool getYMinMax(double &miny, double &maxy, double &smallestGreaterZero) override
get the maximum and minimum y-value of the graph
virtual void drawErrorsBefore(JKQTPEnhancedPainter &painter) override
this function is used to plot error inidcators before plotting the graphs.
JKQTPXYLineErrorGraph(JKQTPlotter *parent)
class constructor
JKQTPXYLineErrorGraph(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 void drawKeyMarker(JKQTPEnhancedPainter &painter, const QRectF &rect) override
plots a key marker inside the specified rectangle rect
bool drawLine
indicates whether to draw a line or not
Definition jkqtplines.h:92
void setDrawLine(bool __value)
indicates whether to draw a line or not
JKQTPXYLineGraph(JKQTBasePlotter *parent=nullptr)
class constructor
void setDrawLineInForeground(bool __value)
indicates whether to draw the line behind or above the symbols
bool getDrawLineInForeground() const
indicates whether to draw the line behind or above the symbols
void setColor(QColor c)
set color of line and symbol
JKQTPXYLineGraph(JKQTPlotter *parent)
class constructor
bool getDrawLine() const
indicates whether to draw a line or not
virtual QColor getKeyLabelColor() const override
returns the color to be used for the key label
virtual void draw(JKQTPEnhancedPainter &painter) override
plots the graph to the plotter object specified as parent
bool drawLineInForeground
indicates whether to draw the line behind or above the symbols
Definition jkqtplines.h:94
virtual ~JKQTPXYLineGraph()
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