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

a simple line plot for JKQTFastPlotter More...

#include <jkqtfastplotter.h>

Inheritance diagram for JKQTFPLinePlot:
[legend]
Collaboration diagram for JKQTFPLinePlot:
[legend]

Public Types

enum  DataType {
  JKQTFPLPPointer ,
  JKQTFPLPVector
}
 used to store which datatype is used for the plot data More...
 

Public Member Functions

 JKQTFPLinePlot (JKQTFastPlotter *parent, int N, double *x, double *y, QColor color=QColor("red"), Qt::PenStyle style=Qt::SolidLine, double width=1)
 class constructor
 
 JKQTFPLinePlot (JKQTFastPlotter *parent, QVector< double > *x, QVector< double > *y, QColor color=QColor("red"), Qt::PenStyle style=Qt::SolidLine, double width=1)
 class constructor
 
virtual void drawGraph (QPainter &painter) override
 draw the graph
 
QColor getColor () const
 color of the graph
 
DataType getDatatype () const
 which type of data is used for plotting ?
 
QColor getErrorLineColor () const
 color of the graph
 
Qt::PenStyle getErrorLineStyle () const
 style of the graph
 
double getErrorLineWidth () const
 width of the graph (in pt)
 
int getN ()
 
Qt::PenStyle getStyle () const
 style of the graph
 
double getWidth () const
 width of the graph (in pt)
 
double * getX () const
 pointer to x-coordinate data to display
 
QVector< double > * getXv () const
 pointer to x-coordinate data to display
 
double * getY () const
 pointer to y-coordinate data to display
 
double * getYerr () const
 pointer to yerr-coordinate data to display
 
QVector< double > * getYerrv () const
 pointer to yerr-coordinate data to display
 
QVector< double > * getYv () const
 pointer to y-coordinate data to display
 
void setColor (const QColor &__value)
 color of the graph
 
void setData (double *x, double *y, double *yerr, int N)
 
void setData (double *x, double *y, int N)
 
void setData (QVector< double > *x, QVector< double > *y)
 
void setData (QVector< double > *x, QVector< double > *y, QVector< double > *yerr)
 
void setErrorLineColor (const QColor &__value)
 color of the graph
 
void setErrorLineStyle (Qt::PenStyle __value)
 style of the graph
 
void setErrorLineWidth (double __value)
 width of the graph (in pt)
 
void setStyle (Qt::PenStyle __value)
 style of the graph
 
void setWidth (double __value)
 width of the graph (in pt)
 
- Public Member Functions inherited from JKQTFPPlot
 JKQTFPPlot (JKQTFastPlotter *parent)
 class constructor
 
virtual ~JKQTFPPlot ()
 virtual class destructor
 
bool isVisible () const
 returns whether this graph is visible inside the plot
 
void paint (QPainter &painter)
 draw the graph
 
void replot ()
 start a replot of the parent widget
 
void setParent (JKQTFastPlotter *parent)
 set the parent of the plot
 

Protected Attributes

QColor color
 color of the graph
 
DataType datatype
 which type of data is used for plotting ?
 
QColor errorColor
 color of the graph
 
Qt::PenStyle errorStyle
 style of the graph
 
double errorWidth
 width of the graph (in pt)
 
int N
 number of datapoints in the plot
 
Qt::PenStyle style
 style of the graph
 
double width
 width of the graph (in pt)
 
double * x
 pointer to x-coordinate data to display
 
QVector< double > * xv
 pointer to x-coordinate data to display
 
double * y
 pointer to y-coordinate data to display
 
double * yerr
 pointer to yerr-coordinate data to display
 
QVector< double > * yerrv
 pointer to yerr-coordinate data to display
 
QVector< double > * yv
 pointer to y-coordinate data to display
 
- Protected Attributes inherited from JKQTFPPlot
JKQTFastPlotterparent
 parent class, i.e. the plotter to plot on
 
bool visible
 indicates whether the plot is visible or not
 

Additional Inherited Members

- Public Slots inherited from JKQTFPPlot
void setVisible (bool visible)
 

Detailed Description

a simple line plot for JKQTFastPlotter

Deprecated:
The class JKQTFastPlotter and all its support classes are deprecated and will be removed in future versions.

This class plots data as (x,y) points connected by straight lines. If errors for the y values are provided, also y+/-yerr errorlines are drawn.

Member Enumeration Documentation

◆ DataType

used to store which datatype is used for the plot data

Enumerator
JKQTFPLPPointer 
JKQTFPLPVector 

Constructor & Destructor Documentation

◆ JKQTFPLinePlot() [1/2]

JKQTFPLinePlot::JKQTFPLinePlot ( JKQTFastPlotter parent,
int  N,
double *  x,
double *  y,
QColor  color = QColor("red"),
Qt::PenStyle  style = Qt::SolidLine,
double  width = 1 
)

class constructor

Parameters
parentparent widget
Nnumber of datapoints in the plot
xpoints to the x values in the plot
ypoints to the y values in the plot
colorcolor of the plot
stylestyle of the graph
widthwidth of the plot (in pt)

◆ JKQTFPLinePlot() [2/2]

JKQTFPLinePlot::JKQTFPLinePlot ( JKQTFastPlotter parent,
QVector< double > *  x,
QVector< double > *  y,
QColor  color = QColor("red"),
Qt::PenStyle  style = Qt::SolidLine,
double  width = 1 
)

class constructor

Parameters
parentparent widget
xpoints to the x values in the plot
ypoints to the y values in the plot
colorcolor of the plot
stylestyle of the graph
widthwidth of the plot (in pt)

Member Function Documentation

◆ drawGraph()

virtual void JKQTFPLinePlot::drawGraph ( QPainter &  painter)
overridevirtual

draw the graph

Implements JKQTFPPlot.

Reimplemented in JKQTFPVCrossPlot, and JKQTFPVBarPlot.

◆ getColor()

QColor JKQTFPLinePlot::getColor ( ) const
inline

color of the graph

◆ getDatatype()

DataType JKQTFPLinePlot::getDatatype ( ) const
inline

which type of data is used for plotting ?

◆ getErrorLineColor()

QColor JKQTFPLinePlot::getErrorLineColor ( ) const
inline

color of the graph

◆ getErrorLineStyle()

Qt::PenStyle JKQTFPLinePlot::getErrorLineStyle ( ) const
inline

style of the graph

◆ getErrorLineWidth()

double JKQTFPLinePlot::getErrorLineWidth ( ) const
inline

width of the graph (in pt)

◆ getN()

int JKQTFPLinePlot::getN ( )
inline

◆ getStyle()

Qt::PenStyle JKQTFPLinePlot::getStyle ( ) const
inline

style of the graph

◆ getWidth()

double JKQTFPLinePlot::getWidth ( ) const
inline

width of the graph (in pt)

◆ getX()

double * JKQTFPLinePlot::getX ( ) const
inline

pointer to x-coordinate data to display

◆ getXv()

QVector< double > * JKQTFPLinePlot::getXv ( ) const
inline

pointer to x-coordinate data to display

◆ getY()

double * JKQTFPLinePlot::getY ( ) const
inline

pointer to y-coordinate data to display

◆ getYerr()

double * JKQTFPLinePlot::getYerr ( ) const
inline

pointer to yerr-coordinate data to display

◆ getYerrv()

QVector< double > * JKQTFPLinePlot::getYerrv ( ) const
inline

pointer to yerr-coordinate data to display

◆ getYv()

QVector< double > * JKQTFPLinePlot::getYv ( ) const
inline

pointer to y-coordinate data to display

◆ setColor()

void JKQTFPLinePlot::setColor ( const QColor &  __value)
inline

color of the graph

◆ setData() [1/4]

void JKQTFPLinePlot::setData ( double *  x,
double *  y,
double *  yerr,
int  N 
)
inline

◆ setData() [2/4]

void JKQTFPLinePlot::setData ( double *  x,
double *  y,
int  N 
)
inline

◆ setData() [3/4]

void JKQTFPLinePlot::setData ( QVector< double > *  x,
QVector< double > *  y 
)
inline

◆ setData() [4/4]

void JKQTFPLinePlot::setData ( QVector< double > *  x,
QVector< double > *  y,
QVector< double > *  yerr 
)
inline

◆ setErrorLineColor()

void JKQTFPLinePlot::setErrorLineColor ( const QColor &  __value)
inline

color of the graph

◆ setErrorLineStyle()

void JKQTFPLinePlot::setErrorLineStyle ( Qt::PenStyle  __value)
inline

style of the graph

◆ setErrorLineWidth()

void JKQTFPLinePlot::setErrorLineWidth ( double  __value)
inline

width of the graph (in pt)

◆ setStyle()

void JKQTFPLinePlot::setStyle ( Qt::PenStyle  __value)
inline

style of the graph

◆ setWidth()

void JKQTFPLinePlot::setWidth ( double  __value)
inline

width of the graph (in pt)

Member Data Documentation

◆ color

QColor JKQTFPLinePlot::color
protected

color of the graph

◆ datatype

DataType JKQTFPLinePlot::datatype
protected

which type of data is used for plotting ?

◆ errorColor

QColor JKQTFPLinePlot::errorColor
protected

color of the graph

◆ errorStyle

Qt::PenStyle JKQTFPLinePlot::errorStyle
protected

style of the graph

◆ errorWidth

double JKQTFPLinePlot::errorWidth
protected

width of the graph (in pt)

◆ N

int JKQTFPLinePlot::N
protected

number of datapoints in the plot

◆ style

Qt::PenStyle JKQTFPLinePlot::style
protected

style of the graph

◆ width

double JKQTFPLinePlot::width
protected

width of the graph (in pt)

◆ x

double* JKQTFPLinePlot::x
protected

pointer to x-coordinate data to display

◆ xv

QVector<double>* JKQTFPLinePlot::xv
protected

pointer to x-coordinate data to display

◆ y

double* JKQTFPLinePlot::y
protected

pointer to y-coordinate data to display

◆ yerr

double* JKQTFPLinePlot::yerr
protected

pointer to yerr-coordinate data to display

◆ yerrv

QVector<double>* JKQTFPLinePlot::yerrv
protected

pointer to yerr-coordinate data to display

◆ yv

QVector<double>* JKQTFPLinePlot::yv
protected

pointer to y-coordinate data to display


The documentation for this class was generated from the following file: