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 */
65 explicit JKQTPXYLineGraph(JKQTBasePlotter* parent=nullptr);
66 /** \brief class constructor */
68
69 /** \brief plots the graph to the plotter object specified as parent */
70 virtual void draw(JKQTPEnhancedPainter& painter) override;
71 /** \brief plots a key marker inside the specified rectangle \a rect */
72 virtual void drawKeyMarker(JKQTPEnhancedPainter& painter, const QRectF& rect) override;
73 /** \brief returns the color to be used for the key label */
74 virtual QColor getKeyLabelColor() const override;
75
76 /** \copydoc drawLine */
77 void setDrawLine(bool __value);
78 /** \copydoc drawLine */
79 bool getDrawLine() const;
80 /** \copydoc drawLineInForeground */
81 void setDrawLineInForeground(bool __value);
82 /** \copydoc drawLineInForeground */
84
85 /** \brief set color of line and symbol */
86 void setColor(QColor c);
87
88 protected:
89
90 /** \brief indicates whether to draw a line or not */
92 /** \brief indicates whether to draw the line behind or above the symbols */
94
95
96};
97
98
99
100
101
102
103/*! \brief This implements xy line plots with x and y error indicators.
104 \ingroup jkqtplotter_linesymbolgraphs_line
105
106 \image html JKQTPXYLineErrorGraph_JKQTPErrorBars.png "setYErrorStyle(JKQTPErrorBars)"
107 \image html JKQTPXYLineErrorGraph_JKQTPErrorLines.png "setYErrorStyle(JKQTPErrorLines)"
108 \image html JKQTPXYLineErrorGraph_JKQTPErrorPolygons.png "setYErrorStyle(JKQTPErrorPolygins;"
109
110 \see jkqtpstatAddXYErrorLineGraph(), jkqtpstatAddXErrorLineGraph(), jkqtpstatAddYErrorLineGraph(), \ref JKQTPlotterErrorBarStyles, \ref JKQTPlotterBasicJKQTPDatastoreStatisticsGroupedStat
111 */
113 Q_OBJECT
114 public:
115 /** \brief class constructor */
117 /** \brief class constructor */
119
120 /** \copydoc JKQTPPlotElement::getXMinMax() */
121 virtual bool getXMinMax(double& minx, double& maxx, double& smallestGreaterZero) override;
122 /** \copydoc JKQTPPlotElement::getYMinMax() */
123 virtual bool getYMinMax(double& miny, double& maxy, double& smallestGreaterZero) override;
124 /** \copydoc JKQTPGraph::usesColumn() */
125 virtual bool usesColumn(int c) const override;
126
127 protected:
128 /** \brief this function is used to plot error inidcators before plotting the graphs. */
129 virtual void drawErrorsBefore(JKQTPEnhancedPainter& painter) override;
130};
131
132
133
134
135
136
137#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
This Mix-In class provides setter/getter methods, storage and other facilities for the graph line sty...
Definition jkqtpgraphsbasestylingmixins.h:49
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
This class is the base class for graphs that only display error indicators in x- and y-direction.
Definition jkqtpgraphsbaseerrors.h:349
This virtual JKQTPGraph descendent may be used as base for all graphs that use at least two columns t...
Definition jkqtpgraphsbase.h:586
This implements xy line plots with x and y error indicators.
Definition jkqtplines.h:112
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
This implements xy line plots. This also alows to draw symbols at the data points.
Definition jkqtplines.h:61
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:91
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:93
plotter widget for scientific plots (uses JKQTBasePlotter to do the actual drawing)
Definition jkqtplotter.h:364
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89