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

base class for 2D plotter classes (used by the plotter widget JKQTPlotter) More...

#include <jkqtpbaseplotter.h>

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

Classes

struct  allPlotElements
 Functor which does not apply any filter to JKQTPPlotElement, e.g. in getGraphsXMinMax() or getGraphsYMinMax() More...
 
struct  filterPlotElementByXAxis
 filter functor which accepts only those JKQTPPlotElement where JKQTPPlotElement::getXAxisRef() returns the JKQTPCoordinateAxisRef supplied to the constructor, e.g. in getGraphsXMinMax() or getGraphsYMinMax() More...
 
struct  filterPlotElementByYAxis
 filter functor which accepts only those JKQTPPlotElement where JKQTPPlotElement::getYAxisRef() returns the JKQTPCoordinateAxisRef supplied to the constructor, e.g. in getGraphsXMinMax() or getGraphsYMinMax() More...
 
class  JKQTPPen
 represents a pen, when plotting in JKQTPlotter/JKQTBasePlotter More...
 
struct  PlotMargin
 used for calculated value: describing a section in the freespace outside the graph area More...
 
class  PlotMargins
 used for calculated value: describing all sections of freespace outside the graph area More...
 
struct  textSizeKey
 internal tool class for text-sizess in a plot key More...
 

Public Types

typedef QMap< QString, QList< QPointer< QAction > > > AdditionalActionsMap
 
typedef QMapIterator< QString, QList< QPointer< QAction > > > AdditionalActionsMapIterator
 

Public Slots

void enableDebugShowRegionBoxes (bool enabled=true)
 if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the different regions in the plot (border, axes, ...)
 
void enableDebugShowTextBoxes (bool enabled=true)
 if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the extent of text in the plot
 
QString getUserSettigsFilename () const
 return the filename, used by loadUserSettings() and saveUserSettings()
 
QString getUserSettigsPrefix () const
 return the prefix, used by loadUserSettings() and saveUserSettings()
 
void loadUserSettings ()
 loads the plot user properties from the file sepcified by setUserSettigsFilename() and the prefix specified by setUserSettigsPrefix()
 
void saveUserSettings () const
 saves the plot user properties to the file sepcified by setUserSettigsFilename() and the prefix specified by setUserSettigsPrefix()
 
void setAbsoluteX (double xminn, double xmaxx)
 sets absolutely limiting x-range of the plot
 
void setAbsoluteXY (double xminn, double xmaxx, double yminn, double ymaxx)
 sets absolutely limiting x- and y-range of the plot
 
void setAbsoluteY (double yminn, double ymaxx)
 sets absolute minimum and maximum y-value to plot
 
void setAspectRatio (double __value)
 sets the data aspect ratio, enforced with setMaintainApsectRatio(true)
 
void setAxisAspectRatio (double __value)
 sets the axis aspect ratio, enforced with setMaintainAxisApsectRatio(true)
 
void setBackgroundBrush (const QBrush &__value)
 color of the background of the plot (widget area) when drawing (to the screen)
 
void setBackgroundColor (const QColor &__value)
 color of the background of the plot (widget area) when drawing (to the screen)
 
void setBackgroundGradient (const QGradient &__value)
 color of the background of the plot (widget area) when drawing (to the screen)
 
void setBackgroundTexture (const QImage &__value)
 color of the background of the plot (widget area) when drawing (to the screen)
 
void setBackgroundTexture (const QPixmap &__value)
 color of the background of the plot (widget area) when drawing (to the screen)
 
void setCSVcommentInitializer (const QString &__value)
 set the string used to introduce comments in text output when exporting data
 
void setCSVdecimalSeparator (const QString &__value)
 set the decimal separator used when exporting data to text files
 
void setCurrentFileFormat (const QString &__value)
 set the file format to use in SaveAs ... dialogs
 
void setCurrentSaveDirectory (const QString &__value)
 sets the current directory in which to open SaveAs ... dialogs
 
void setDefaultTextColor (QColor __value)
 default text color in the plot
 
void setDefaultTextFontName (const QString &__value)
 default font name in the plot
 
void setDefaultTextSize (double __value)
 default font size in the plot [pt]
 
void setExportBackgroundBrush (const QBrush &__value)
 color of the background of the plot (widget area) when exporting
 
void setExportBackgroundColor (const QColor &__value)
 color of the background of the plot (widget area) when exporting
 
void setExportBackgroundGradient (const QGradient &__value)
 color of the background of the plot (widget area) when exporting
 
void setExportBackgroundTexture (const QImage &__value)
 color of the background of the plot (widget area) when exporting
 
void setExportBackgroundTexture (const QPixmap &__value)
 color of the background of the plot (widget area) when exporting
 
void setGrid (bool val)
 sets whether the major grid lines of the major axes are shown
 
void setGridColor (QColor color)
 sets the color of all major grid lines (of the major x- and y-axis)
 
void setGridStyle (Qt::PenStyle __value)
 sets the style of all Major grid lines
 
void setGridWidth (double __value)
 sets the width of all Major grid lines
 
void setKeyPosition (const JKQTPKeyPosition &__value)
 key position inside or besides the plot area, see JKQTPKeyPositions for details and examples
 
void setMaintainAspectRatio (bool value)
 en-/disables the maintaining of the data aspect ratio
 
void setMaintainAxisAspectRatio (bool value)
 en-/disables the maintaining of the axis aspect ratio
 
void setMinorGridColor (QColor color)
 sets the color of all minor grid lines (of the major x- and y-axis)
 
void setMinorGridStyle (Qt::PenStyle __value)
 sets the style of all minor grid lines
 
void setMinorGridWidth (double __value)
 sets the width of all minor grid lines
 
void setOnlyGraphVisible (int i)
 set all graphs invisible, except i
 
void setOnlyNthGraphsVisible (int start, int n)
 set all graphs invisible, except graph start, start+n, start+2*n, ...
 
void setPlotBackgroundBrush (const QBrush &__value)
 color of the plot's background (i.e. of the area within the coordinate axes rectangle)
 
void setPlotBackgroundColor (const QColor &__value)
 color of the plot's background (i.e. of the area within the coordinate axes rectangle)
 
void setPlotBackgroundGradient (const QGradient &__value)
 color of the plot's background (i.e. of the area within the coordinate axes rectangle)
 
void setPlotBackgroundTexture (const QImage &__value)
 color of the plot's background (i.e. of the area within the coordinate axes rectangle)
 
void setPlotBackgroundTexture (const QPixmap &__value)
 color of the plot's background (i.e. of the area within the coordinate axes rectangle)
 
void setPlotBorder (int left, int right, int top, int bottom)
 sets the borders of the plot
 
void setPlotBorderBottom (int bottom)
 sets the bottom border of the plot
 
void setPlotBorderLeft (int left)
 sets the left border of the plot
 
void setPlotBorderRight (int right)
 sets the right border of the plot
 
void setPlotBorderTop (int top)
 sets the top border of the plot
 
void setPlotFrameColor (QColor col)
 if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this color
 
void setPlotFrameRounding (double __value)
 if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot, rounding the corners with this redius (<=0 -> no rounded rectangle) [pt]
 
void setPlotFrameVisible (bool enabled)
 if true, JKQTBasePlotter will draw a rectangle/frame around the plot
 
void setPlotFrameWidth (double __value)
 if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this width [pt]
 
void setPlotLabel (const QString &__value)
 set the plot label text
 
void setPlotLabelColor (QColor __value)
 the plot label color
 
void setplotLabelFontName (const QString &__value)
 the plot label font name
 
void setPlotLabelFontSize (double __value)
 the plot label font size [pt]
 
void setPlotLabelOffset (double __value)
 offset of the plot label from the next element of the graph, i.e. below the label [pt].
 
void setPlotLabelTopBorder (double __value)
 offset of the plot label from the top [pt].
 
void setShowKey (bool __value)
 indicates whether to plot a key
 
void setShowZeroAxes (bool showX, bool showY)
 switches the visibility of the zero-axes associated with the major x- and y-axis
 
void setShowZeroAxes (bool showXY)
 switches the visibility of the zero-axes associated with the major x- and y-axis
 
void setUseAntiAliasingForGraphs (bool __value)
 specifies whether to use antialiasing for plotting the graphs
 
void setUseAntiAliasingForSystem (bool __value)
 specifies whether to use antialiasing for plotting the coordinate system
 
void setUseAntiAliasingForText (bool __value)
 specifies whether to use antialiasing when drawing any text
 
void setUserSettigsFilename (const QString &filename)
 set filename, used by loadUserSettings() and saveUserSettings()
 
void setUserSettigsFilename (const QString &filename, const QString &prefix)
 set filename and prefix, used by loadUserSettings() and saveUserSettings()
 
void setUserSettigsPrefix (const QString &prefix)
 set prefix, used by loadUserSettings() and saveUserSettings()
 
void setWidgetHeight (int heigh)
 sets the width of the plot widget
 
void setWidgetSize (int width, int height)
 resize the plot
 
void setWidgetSize (QSize size)
 resize the plot
 
void setWidgetWidth (int wid)
 sets the width of the plot widget
 
void setX (double xminn, double xmaxx, bool affectsSecondaryAxes=false)
 sets the x-range of the plot (minimum and maximum x-value on the x-axis)
 
void setXY (double xminn, double xmaxx, double yminn, double ymaxx, bool affectsSecondaryAxes=false)
 sets the x- and y-range of the plot (minimum and maximum values on the x-/y-axis)
 
void setY (double yminn, double ymaxx, bool affectsSecondaryAxes=false)
 sets the y-range of the plot (minimum and maximum y-value on the y-axis)
 
void zoom (double xminn, double xmaxx, double yminn, double ymaxx, bool affectsSecondaryAxes=false)
 sets the x- and y-range of the plot (minimum and maximum values on the x-/y-axis)
 
void zoomIn (double factor=2.0)
 zooms into the graph (the same as turning the mouse wheel) by the given factor
 
void zoomOut (double factor=2.0)
 zooms out of the graph (the same as turning the mouse wheel) by the given factor
 
void zoomToFit (bool zoomX=true, bool zoomY=true, bool includeX0=false, bool includeY0=false, double scaleX=1.05, double scaleY=1.05)
 this method zooms the graph so that all plotted datapoints are visible.
 

Signals

void beforePlotScalingRecalculate ()
 emitted before the plot scaling has been recalculated
 
void plotScalingRecalculated ()
 emitted when the plot scaling had to be recalculated
 
void plotUpdated ()
 emitted when the plot has to be updated
 
void zoomChangedLocally (double newxmin, double newxmax, double newymin, double newymax, JKQTBasePlotter *sender)
 signal: emitted whenever the user selects a new x-y zoom range (in the major axes, e.g. setX(), setY(), setXY(), zoomToFit()... )
 

Public Member Functions

Konstruktion and Destruction
 JKQTBasePlotter (bool datastore_internal, QObject *parent=nullptr, JKQTPDatastore *datast=nullptr)
 class constructor
 
 JKQTBasePlotter ()=delete
 
virtual ~JKQTBasePlotter ()
 class destructor
 
Plot Data Storage/Management (JKQTPDatastore)
JKQTPDatastoregetDatastore ()
 returns a pointer to the datastore used by this object
 
const JKQTPDatastoregetDatastore () const
 returns a pointer to the datastore used by this object
 
void useExternalDatastore (JKQTPDatastore *newStore)
 tells the plotter object to use the given external datastore.
 
void useAsInternalDatastore (JKQTPDatastore *newStore)
 tells the plotter object to use the given external datastore and treat it as an internal one (i.e. free it when the plotter object ist destroyed.
 
void useInternalDatastore ()
 tells the plotter object to use an internal datastore. A new internal datastore object is generated only if the current datastore is not internal.
 
void forceInternalDatastore ()
 tells the plotter object to use an internal datastore (just like useInternalDatastore() ), but forces the generation of a new datastore, even if the current one is already internal (the current one will be freed in the lather case
 
Plot Styling & Settings Management
void loadSettings (const QSettings &settings, const QString &group=QString("plots/"))
 loads all the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object
 
void saveSettings (QSettings &settings, const QString &group=QString("plots/")) const
 saves the plot properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object.
 
const JKQTBasePlotterStylegetCurrentPlotterStyle () const
 current style properties for this JKQTBasePlotter
 
void setCurrentPlotterStyle (const JKQTBasePlotterStyle &style)
 replace the current style properties for this JKQTBasePlotter
 
void loadCurrentPlotterStyle (const QSettings &settings, const QString &group="plots/")
 replace the current style properties for this JKQTBasePlotter with properties loaded from settings
 
void saveCurrentPlotterStyle (QSettings &settings, const QString &group="plots/") const
 store the current style properties for this JKQTBasePlotter with properties loaded from settings
 
void loadUserSettings (const QSettings &settings, const QString &group=QString("plots_user/"))
 loads the plot user properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object
 
void saveUserSettings (QSettings &settings, const QString &group=QString("plots_user/")) const
 saves the plot user properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object.
 
int getNextStyle ()
 gets the next unused style id, i.e. the smalles number >=0 which is not contained in usedStyles
 
JKQTPPen getPlotStyle (int i, JKQTPPlotStyleType type=JKQTPPlotStyleType::Default) const
 returns a QPen object for the i-th plot style
 
Utilities: Unit Transforms
double didot2px (double pt, double dpi) const
 returns the given size in Didot points (0.376 mm) to pixels (with given dots per inch)
 
double didot2px (double pt, JKQTPEnhancedPainter &painter) const
 returns the given size in Didot points (0.376 mm) to pixels (with dpi from painter)
 
double didot2px (JKQTPEnhancedPainter &painter, double pt) const
 returns the given size in Didot points (0.376 mm) to pixels (with dpi from painter)
 
double pt2px (double pt, double dpi) const
 returns the given size in DTP points points (1/72inch = 0.353mm) to pixels (with given dots per inch)
 
double pt2px (double pt, JKQTPEnhancedPainter &painter) const
 returns the given size in DTP points points (1/72inch = 0.353mm) to pixels (with given dots per inch)
 
double pt2px (JKQTPEnhancedPainter &painter, double pt) const
 returns the given size in DTP points points (1/72inch = 0.353mm) to pixels (with given dots per inch)
 
double mm2px (double mm, double dpi) const
 returns the given size in millimeters to pixels (with given dots per inch)
 
double mm2px (double mm, JKQTPEnhancedPainter &painter) const
 returns the given size in millimeters to pixels (with given dots per inch)
 
double mm2px (JKQTPEnhancedPainter &painter, double mm) const
 returns the given size in millimeters to pixels (with given dots per inch)
 
double x2p (double x) const
 return x-pixel coordinate from x coordinate, using the primary axis
 
double y2p (double y) const
 return y-pixel coordinate from y coordinate, using the primary axis
 
double p2x (double x) const
 return x coordinate from x-pixel, using the primary axis
 
double p2y (double y) const
 return y coordinate from y-pixel, using the primary axis
 
Access to Plot Properties
int getWidth ()
 gets the width of the plot widget
 
int getHeight ()
 gets the width of the plot widget
 
double getXMin () const
 returns the current x-axis min of the primary x-axis
 
double getXMax () const
 returns the current x-axis max of the primary x-axis
 
double getYMin () const
 returns the current y-axis min of the primary y-axis
 
double getYMax () const
 returns the current y-axis max of the primary y-axis
 
double getAbsoluteXMin () const
 returns the absolute x-axis min of the primary x-axis. This is the lowest allowed value the the axis min/max.
 
double getAbsoluteXMax () const
 returns the absolute x-axis max of the primary x-axis This is the highest allowed value the the axis min/max.
 
double getAbsoluteYMin () const
 returns the absolute y-axis min of the primary y-axis This is the lowest allowed value the the axis min/max.
 
double getAbsoluteYMax () const
 returns the absolute y-axis max of the primary y-axis This is the highest allowed value the the axis min/max.
 
void addGridPrintingPlotter (size_t x, size_t y, JKQTBasePlotter *plotter)
 add a new plotter for grid printing mode
 
void clearGridPrintingPlotters ()
 clear all additional plotters for grid printing mode
 
Coordinate Axis Management
JKQTPHorizontalAxisBasegetXAxis (JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis)
 returns the x-axis objet of the plot
 
JKQTPVerticalAxisBasegetYAxis (JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis)
 returns the y-axis objet of the plot
 
const JKQTPHorizontalAxisBasegetXAxis (JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) const
 returns the x-axis objet of the plot
 
const JKQTPVerticalAxisBasegetYAxis (JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) const
 returns the y-axis objet of the plot
 
bool hasXAxis (JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) const
 returns whether an x-axis axis is registered with the plotter
 
bool hasYAxis (JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) const
 returns whether a y-axis axis is registered with the plotter
 
QSet< JKQTPCoordinateAxisRefgetAvailableXAxisRefs (bool includePrimary=false) const
 returns the set of available x-axes (including the primary, if true is given as parameter)
 
QSet< JKQTPCoordinateAxisRefgetAvailableYAxisRefs (bool includePrimary=false) const
 returns the set of available y-axes (including the primary, if true is given as parameter)
 
QMap< JKQTPCoordinateAxisRef, JKQTPHorizontalAxisBase * > getXAxes (bool includePrimary=true)
 returns all available x-axes
 
QMap< JKQTPCoordinateAxisRef, JKQTPVerticalAxisBase * > getYAxes (bool includePrimary=true)
 returns all available y-axes
 
QList< JKQTPCoordinateAxis * > getAxes (bool includePrimaries=true)
 returns all available x- or y-axes
 
QList< const JKQTPCoordinateAxis * > getAxes (bool includePrimaries=true) const
 returns all available x- or y-axes
 
JKQTPCoordinateAxisRef addSecondaryXAxis (JKQTPHorizontalAxisBase *axis)
 adds a secondary x-axis
 
JKQTPCoordinateAxisRef addSecondaryYAxis (JKQTPVerticalAxisBase *axis)
 adds a secondary y-axis
 
void updateSecondaryAxes ()
 updates the secondary axes
 
void correctXYRangeForAspectRatio (double &xminn, double &xmaxx, double &yminn, double &ymaxx) const
 takes a new axis range xminn ... xmaxx and yminn ... ymaxx and corrects the values to match the currently set axisAspectRatio
 
Key Management Management
JKQTPBaseKeygetMainKey ()
 retuns the main key object
 
const JKQTPBaseKeygetMainKey () const
 retuns the main key object
 
QActions Management
QAction * getActionSavePlot () const
 QAction which triggers saving of the plot as an image.
 
QAction * getActionSaveData () const
 QAction which triggers saving of the data used for the plot.
 
QAction * getActionCopyData () const
 QAction which triggers copying of the data to the clipboard.
 
QAction * getActionCopyPixelImage () const
 QAction which triggers copying of the image to the clipboard.
 
QAction * getActionCopyMatlab () const
 QAction which triggers copying of the data to the clipboard in Matlab format.
 
QAction * getActionSavePDF () const
 QAction which triggers the saving as PDF.
 
QAction * getActionSaveSVG () const
 QAction which triggers the saving as Scalable Vector Graphics (SVG)
 
QAction * getActionPrint () const
 QAction which triggers the printing.
 
QAction * getActionSavePix () const
 QAction which triggers the saving as pixel image.
 
QAction * getActionSaveCSV () const
 QAction which triggers the saving as CSV (data only)
 
QAction * getActionZoomAll () const
 QAction which triggers zoom all.
 
QAction * getActionZoomIn () const
 QAction which triggers zoom in.
 
QAction * getActionZoomOut () const
 QAction which triggers zoom out.
 
QAction * getActionShowPlotData () const
 QAction to show a table with all the plot data in the datastore.
 
AdditionalActionsMap getLstAdditionalPlotterActions () const
 this list contains additional actions, that can be registered by registerAdditionalAction(). They are shown in the context menu only and are e.g. used to display "save image data" actions. Each action may be in a category (key of map), which is displayed as a submenu of the context-menu!
 
void registerAdditionalAction (const QString &key, QAction *act)
 this function registers additional actions to lstAdditionalPlotterActions, which are displayed in the context-menu
 
void deregisterAdditionalAction (QAction *act)
 this function deregisters an additional action, previously added with registerAdditionalAction()
 
Utilities: (math-markup) Text Sizing
JKQTMathTextNodeSize getTextSizeDetail (const QFont &fm, const QString &text, QPainter &painter)
 calculates a JKQTMathTextNodeSize for the given string text if it would be drawn on painter with font fm
 
JKQTMathTextNodeSize getTextSizeDetail (const QString &fontName, double fontSize, const QString &text, QPainter &painter)
 calculates a JKQTMathTextNodeSize for the given string text if it would be drawn on painter with font fontName
 
void getTextSizeDetail (const QString &fontName, double fontSize, const QString &text, QPainter &painter, double &width, double &ascent, double &descent, double &strikeoutPos)
 calculates a text-size details for the given string text if it would be drawn on painter with font fontName and font size fontSize
 
void getTextSizeDetail (const QFont &fm, const QString &text, QPainter &painter, double &width, double &ascent, double &descent, double &strikeoutPos)
 calculates a text-size details for the given string text if it would be drawn on painter with font fm
 
QSizeF getTextSizeSize (const QFont &fm, const QString &text, QPainter &painter)
 calculates a size of the given string text if it would be drawn on painter with font fm
 
QSizeF getTextSizeSize (const QString &fontName, double fontSize, const QString &text, QPainter &painter)
 calculates a size of the given string text if it would be drawn on painter with font fontName and font size fontSize
 
JKQTMathTextgetMathText ()
 returns the internal JKQTMathText, used to render text with LaTeX markup
 
const JKQTMathTextgetMathText () const
 returns the internal JKQTMathText, used to render text with LaTeX markup
 

Static Public Member Functions

static void deregisterPaintDeviceAdapter (JKQTPPaintDeviceAdapter *adapter)
 de-register a JKQTPPaintDeviceAdapter from JKQTBasePlotter/JKQTPlotter
 
static bool deregisterSaveDataAdapter (JKQTPSaveDataAdapter *adapter)
 de-register a JKQTPSaveDataAdapter from JKQTPlotter/JKQTBasePlotter
 
static void registerPaintDeviceAdapter (JKQTPPaintDeviceAdapter *adapter)
 register a user-defined QPaintDevice (with factory JKQTPPaintDeviceAdapter) as a plugin to JKQTBasePlotter/JKQTPlotter, which will use it to export graphics
 
static bool registerSaveDataAdapter (JKQTPSaveDataAdapter *adapter)
 register a JKQTPSaveDataAdapter with JKQTPlotter/JKQTBasePlotter that can be used to export data from the internal datastore into a file
 
static void setDefaultJKQTBasePrinterUserSettings (QString userSettigsFilename, const QString &userSettigsPrefix)
 set a global preset/default value for the userSettigsFilename and userSettigsPrefix properties of JKQTBasePlotter
 

Protected Types

enum  PlotMarginSide {
  sideLeft ,
  sideRight ,
  sideTop ,
  sideBottom
}
 enum to indicate relative position from a central position More...
 
enum  PlotMarginUse {
  muOutermost =0 ,
  muUserBorder =0 ,
  muPlotTitle ,
  muKey ,
  muGraphsOutside ,
  muAxesOutsideExtend ,
  muAxesOutside ,
  muUsesCount ,
  muInnermost =muUsesCount-1
}
 used for calculated value:describing what freespace outside the graph area is used for More...
 

Protected Slots

void exportpreviewPaintRequested (JKQTPEnhancedPainter &painter, QSize size)
 internal function for export preview
 
void getDataColumnsByUserCheckAll ()
 internal function for getDataColumnsByUser()
 
void getDataColumnsByUserCheckNone ()
 internal function for getDataColumnsByUser()
 
void getDataColumnsByUserComboBoxSelected (const QString &name)
 internal function for getDataColumnsByUser()
 
void getDataColumnsByUserItemChanged (QListWidgetItem *widgetitem)
 internal function for getDataColumnsByUser()
 
void getDataColumnsByUserSave ()
 internal function for getDataColumnsByUser()
 
void printpreviewPaintRequested (QPrinter *printer)
 internal function for print preview
 
void printpreviewPaintRequestedNewPaintDevice (QPaintDevice *paintDevice)
 internal function for print preview
 
void printpreviewPaintRequestedNewPrinter (QPrinter *printer)
 internal function for print preview
 
void printpreviewSetAspectRatio (bool checked)
 internal function for print preview
 
void printpreviewSetFontSizeMultiplier (double value)
 internal function for print preview
 
void printpreviewSetKeepAbsFontsize (bool checked)
 internal function for print preview
 
void printpreviewSetLineWidthMultiplier (double value)
 internal function for print preview
 
void printpreviewSetMagnification (double value)
 internal function for print preview
 
void printpreviewSetMagnificationNew (double value)
 internal function for print preview
 
void printpreviewSetSizeX (double value)
 internal function for print preview
 
void printpreviewSetSizeXNew (double value)
 internal function for print preview
 
void printpreviewSetSizeY (double value)
 internal function for print preview
 
void printpreviewSetSizeYNew (double value)
 internal function for print preview
 
void printpreviewSetZoom (double value)
 internal function for print preview
 
void printpreviewToggleMagnification (bool checked)
 internal function for print preview
 
void printpreviewUpdate ()
 internal function for print preview
 
void showPlotData ()
 internal function for getDataColumnsByUser()
 
void synchronizeXAxis (double newxmin, double newxmax, double newymin, double newymax, JKQTBasePlotter *sender)
 may be connected to zoomChangedLocally() of a different plot and synchronizes the local x-axis to the other x-axis
 
void synchronizeXYAxis (double newxmin, double newxmax, double newymin, double newymax, JKQTBasePlotter *sender)
 may be connected to zoomChangedLocally() of a different plot and synchronizes the local x- and y-axis to the other x- and y-axis
 
void synchronizeYAxis (double newxmin, double newxmax, double newymin, double newymax, JKQTBasePlotter *sender)
 may be connected to zoomChangedLocally() of a different plot and synchronizes the local y-axis to the other y-axis
 
void updatePreviewLabel ()
 internal function for print/export preview
 

Protected Member Functions

QRectF calcPlotMarginRect (PlotMarginUse use, PlotMarginSide side) const
 calculate the rectangle to be used for a given PlotMarginUse on the indicated side of the plot
 
QRectF calcPlotRect () const
 calculate the rectangle of the plot (excluding all margins)
 
void calcPlotScaling (JKQTPEnhancedPainter &painter)
 calculate the scaling and offset values from axis min/max values
 
void drawGraphs (JKQTPEnhancedPainter &painter)
 plot the graphs in the order they appear in the list graphs, i.e. initially the order of the addGraph() calls. So the graph at the end of the list is drawn ON TOP.
 
void drawKey (JKQTPEnhancedPainter &painter)
 plot a key
 
void drawPlot (JKQTPEnhancedPainter &painter)
 paints the plot onto the given JKQTPEnhancedPainter object
 
void drawPlotLabel (JKQTPEnhancedPainter &painter)
 plot the plot label
 
void drawSystemGrid (JKQTPEnhancedPainter &painter)
 plot the grid
 
void drawSystemXAxis (JKQTPEnhancedPainter &painter)
 plot the x coordinate axis (incl. labels)
 
void drawSystemYAxis (JKQTPEnhancedPainter &painter)
 plot the x coordinate axis (incl. labels)
 
bool exportpreview (QSizeF pageSize, bool unitIsMM=false)
 show the export preview window for a given page size pageSize, either in pixels (unitIsMM ==false ) or in millimeters (unitIsMM ==true )
 
QSet< int > getDataColumnsByUser ()
 
double getPaintMagnification () const
 this is an internal property that is used by the export/print system to control the "magnification". Usually this is 1.0 but if set !=1.0, it is used to scale the widgetWidth and widgetHeight before painting!
 
double getPrintMagnification () const
 
void gridPaint (JKQTPEnhancedPainter &painter, QSizeF pageRect, bool scaleIfTooLarge=true, bool scaleIfTooSmall=true)
 simply calls paintPlot() if grid printing mode is deactivated and prints the graph grid otherwise pageRect is used to determine the size of the page to draw on. If this does not coincide with the widget extents this function calculates a scaling factor so the graphs fit onto the page. This is especially usefull when printing!
 
void gridPrintingCalc ()
 This method goes through all registered plotters and calculates the width of every column and height of every row as the max over the row/column. The reults are stored in the private datamembers gridPrintingRows and gridPrintingColumns. gridPrintingSize will contain the size of all graphs together afterwards.
 
void initSettings ()
 set the standard settings (colors, line widths ...)
 
bool printpreviewNew (QPaintDevice *paintDevice, bool setAbsolutePaperSize=false, double printsizeX_inMM=-1.0, double printsizeY_inMM=-1.0, bool displayPreview=true)
 show the print preview window for a given print p
 
void propagateStyle ()
 copy sub-properties of plotterStyle to sub-objects that require it (axes, axes in graphs ...) and emit a plot update
 
void setFontSizeMultiplier (double __value)
 multiplier for the font size
 
void setLineWidthMultiplier (double __value)
 multiplier or the line widths
 
void setPaintMagnification (double __value)
 this is an internal property that is used by the export/print system to control the "magnification". Usually this is 1.0 but if set !=1.0, it is used to scale the widgetWidth and widgetHeight before painting!
 
void setPrintMagnification (double __value)
 

Protected Attributes

QAction * actCopyData
 QAction which triggers copying of the data to the clipboard.
 
QAction * actCopyMatlab
 QAction which triggers copying of the data to the clipboard in Matlab format.
 
QAction * actCopyPixelImage
 QAction which triggers copying of the image to the clipboard.
 
QAction * actPrint
 QAction which triggers the printing.
 
QAction * actSaveCSV
 QAction which triggers the saving as CSV (data only)
 
QAction * actSaveData
 QAction which triggers saving of the data used for the plot.
 
QAction * actSavePDF
 QAction which triggers the saving as PDF.
 
QAction * actSavePix
 QAction which triggers the saving as pixel image.
 
QAction * actSavePlot
 QAction which triggers saving of the plot as an image.
 
QAction * actSaveSVG
 QAction which triggers the saving as Scalable Vector Graphics (SVG)
 
QAction * actShowPlotData
 QAction to show a table with all the plot data in the datastore.
 
QAction * actZoomAll
 QAction which triggers zoom all.
 
QAction * actZoomIn
 QAction which triggers zoom in.
 
QAction * actZoomOut
 QAction which triggers zoom out.
 
double aspectRatio
 the aspect ratio of plotwidth and plotheight to maintain, if maintainAspectRatio==true
 
double axisAspectRatio
 the aspect ratio of axis widths to maintain, if maintainAxisAspectRatio==true
 
QString currentDataFileFormat
 the current file format to use in SaveDataAs ... dialogs
 
QString currentFileFormat
 the current file format to use in SaveAs ... dialogs
 
QString currentPrinter
 the currently selected printer
 
QString currentSaveDirectory
 the current directory in which to open SaveAs ... dialogs
 
QComboBox * dataColumnsCombobox
 
QListWidget * dataColumnsListWidget
 
JKQTPDatastoredatastore
 an object which manages all data columns for this plotter class
 
bool datastoreInternal
 indicates whether the datastore is managed (allocated/freed) internally or externally
 
bool emitPlotSignals
 controls, whether the signals plotUpdated() are emitted
 
bool emitSignals
 specifies whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate()
 
double fontSizeMultiplier
 multiplier for the font size
 
double fontSizePrintMultiplier
 multiplier which is used for font sizes when the plot is exported/printed
 
QMap< QString, QStringList > getDataColumnsByUserSaved
 
GraphsList graphs
 a vector that contains all graphs to be plottet in the system
 
bool gridPrinting
 indicates whether the grid printing is activated
 
QList< size_t > gridPrintingColumns
 this list contains all the columns of the current grid printing and stores its widths
 
size_t gridPrintingCurrentX
 x position of the current graph in grid printing
 
size_t gridPrintingCurrentY
 y position of the current graph in grid printing
 
QList< JKQTPGridPrintingItemgridPrintingList
 list that manages all the additional graphs for grid printing mode
 
QList< size_t > gridPrintingRows
 this list contains all the rows of the current grid printing and stores its heights
 
QSizeF gridPrintingSize
 size of all plots in grid printing mode, filled by gridPrintingCalc()
 
double internalPlotBorderBottom
 calculated value: free space between widget top border and plot top border, as used to plot the graph
 
double internalPlotBorderLeft
 calculated value: free space between widget top border and plot top border, as used to plot the graph
 
double internalPlotBorderRight
 calculated value: free space between widget top border and plot top border, as used to plot the graph
 
double internalPlotBorderTop
 calculated value: free space between widget top border and plot top border, as used to plot the graph
 
int internalPlotHeight
 calculated value: plot height in pixel inside the widget (calculated by calcPlotScaling() from plotBorderTop, plotBorderBottom and widgetHeight)
 
JKQTPBaseKey::KeySizeDescription internalPlotKeyDescription
 calculated value: size and location of the plot key
 
PlotMargins internalPlotMargins
 calculated value: description of free space between actual plot and widget borders
 
int internalPlotWidth
 calculated value: plot width in pixel inside the widget (calculated by calcPlotScaling() from plotBorderLeft, plotBorderRight and widgetWidth)
 
double internalTitleHeight
 calculated value: height of the plot title (or 0 if no title)
 
double lineWidthMultiplier
 multiplier or the line widths
 
double lineWidthPrintMultiplier
 multiplier which is used for linewidths when the plot is exported/printed
 
AdditionalActionsMap lstAdditionalPlotterActions
 this list contains additional actions, that can be registered by registerAdditionalAction(). They are shown in the context menu only and are e.g. used to display "save image data" actions. Each action may be in a category (key of map), which is displayed as a submenu of the context-menu!
 
JKQTPGraphsModelm_plotsModel
 model representing all Plots in this plotter and showing their visible/invisible state
 
JKQTPBaseKeymainKey
 key objects used for the main plot key
 
bool maintainAspectRatio
 indicates whether the widget should maintain an aspect ratio of plotwidth and plotheight
 
bool maintainAxisAspectRatio
 indicates whether the axes should maintain an aspect ratio
 
JKQTBasePlottermasterPlotterX
 the master plotter for x-dimension, this plotter is connected to.
 
JKQTBasePlottermasterPlotterY
 the master plotter for y-dimension, this plotter is connected to.
 
bool masterSynchronizeHeight
 synchronize plot height with masterPlotterY
 
bool masterSynchronizeWidth
 synchronize plot width with masterPlotterX
 
JKQTMathText mathText
 used to plot LaTeX markup
 
double paintMagnification
 this is an internal property that is used by the export/print system to control the "magnification". Usually this is 1.0 but if set !=1.0, it is used to scale the widgetWidth and widgetHeight before painting!
 
QString plotLabel
 the plot label text
 
JKQTBasePlotterStyle plotterStyle
 current style properties for this JKQTBasePlotter instance
 
QMap< JKQTPCoordinateAxisRef, JKQTPHorizontalAxisBase * > secondaryXAxis
 objects used a secondary x-axes
 
QMap< JKQTPCoordinateAxisRef, JKQTPVerticalAxisBase * > secondaryYAxis
 objects used a secondary y-axes
 
bool useClipping
 indicates whether to use clipping (hack for printing, see print() )
 
QList< int > usedStyles
 internal: used to store a list of all currently used plot styles
 
QString userSettigsFilename
 filename for the ini file in which to save the user settings
 
QString userSettigsPrefix
 prefix for the ini file in which to save the user settings
 
int widgetHeight
 height of the plot widget
 
int widgetWidth
 width of the plot widget
 
JKQTPHorizontalAxisxAxis
 object used for the x-axis
 
JKQTPVerticalAxisyAxis
 object used for the y-axis
 

Static Protected Attributes

static QString globalUserSettigsFilename
 
static QString globalUserSettigsPrefix
 
static std::mutex globalUserSettingsMutex
 
static JKQTPSynchronized< QList< JKQTPPaintDeviceAdapter * > > jkqtpPaintDeviceAdapters
 
static JKQTPSynchronized< QList< JKQTPSaveDataAdapter * > > jkqtpSaveDataAdapters
 

Private Attributes

QPointer< QLabel > exportPreviewLabel
 
bool exportUnitInMM
 
double printAspect
 
bool printDoUpdate
 
bool printKeepAbsoluteFontSizes
 
bool printKeepAspect
 
double printMagnification
 
QSizeF printPageSizeMM
 
QPointer< QPrintPreviewWidget > printPreview
 
bool printScaleToPagesize
 
bool printSetAbsolutePageSize
 
bool printSetAbsolutePlotSize
 
double printSizeX_Millimeter
 
double printSizeY_Millimeter
 
double printZoomFactor
 
QPointer< JKQTPEnhancedDoubleSpinBoxspinMagnification
 
QPointer< JKQTPEnhancedDoubleSpinBoxspinSizeX
 
QPointer< JKQTPEnhancedDoubleSpinBoxspinSizeY
 

Master/Slave Plot Synchronization

enum  SynchronizationDirection {
  sdXAxis ,
  sdYAxis ,
  sdXYAxes
}
 denotes, which axes to synchronize in synchronizeToMaster() More...
 
bool getMasterSynchronizeWidth () const
 synchronize plot width with masterPlotterX
 
bool getMasterSynchronizeHeight () const
 synchronize plot height with masterPlotterY
 
void synchronizeToMaster (JKQTBasePlotter *master, SynchronizationDirection synchronizeDirection, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true)
 synchronize the plot borders (and zooming) with a given plotter (master --> slave/this)
 
void synchronizeXToMaster (JKQTBasePlotter *master, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true)
 synchronize the plot x-axis width (and x-zooming) with a given master plotter (master --> slave/this)
 
void synchronizeYToMaster (JKQTBasePlotter *master, bool synchronizeAxisLength=true, bool synchronizeZoomingMasterToSlave=true, bool synchronizeZoomingSlaveToMaster=true)
 synchronize the plot y-axis height (and y-zooming) with a given master plotter (master --> slave/this)
 
void resetMasterSynchronization (SynchronizationDirection synchronizeDirection=sdXYAxes)
 switches any synchronization off, that has been created by synchronizeToMaster()
 

Graphs Management

typedef QVector< JKQTPPlotElement * > GraphsList
 
typedef QVector< JKQTPPlotElement * >::iterator GraphsIterator
 
typedef QVector< JKQTPPlotElement * >::const_iterator GraphsConstIterator
 
typedef std::function< bool(const JKQTPPlotElement *)> PlotElementPreciate
 Functor which can be used as filter predicate for getGraphsXMinMax() or getGraphsYMinMax()
 
const JKQTPGraphsModelgetPlotsModel () const
 returns model representing all Plots in this plotter and showing their visible/invisible state
 
JKQTPGraphsModelgetPlotsModel ()
 returns model representing all Plots in this plotter and showing their visible/invisible state
 
JKQTPPlotElementgetGraph (size_t i)
 returns description of i'th graph
 
const JKQTPPlotElementgetGraph (size_t i) const
 returns description of i'th graph
 
size_t getGraphCount () const
 returns the number of graphs
 
void deleteGraph (size_t i, bool deletegraph=true)
 remove the i-th graph
 
void deleteGraph (JKQTPPlotElement *gr, bool deletegraph=true)
 remove the given graph, if it is contained
 
const GraphsListgetGraphs () const
 returns a const list of all graphs
 
GraphsListgetGraphs ()
 returns a list of all graphs
 
GraphsConstIterator beginGraphs () const
 returns a const iterator to the first graph
 
GraphsConstIterator endGraphs () const
 returns a const iterator behind the last graph
 
GraphsConstIterator cbeginGraphs () const
 returns a const iterator to the first graph
 
GraphsConstIterator cendGraphs () const
 returns a const iterator behind the last graph
 
GraphsIterator beginGraphs ()
 returns an iterator to the first graph
 
GraphsIterator endGraphs ()
 returns an iterator behind the last graph
 
size_t addGraphOnTop (JKQTPPlotElement *gr)
 add a new graph at the end of the graphs, if the graph is already in the plot, it is moved to the end of the list
 
size_t addGraph (JKQTPPlotElement *gr)
 
size_t addGraphAtBottom (JKQTPPlotElement *gr)
 add a new graph before all other graphs (i.e. at the top of the list of graphs), if the graph is already in the plot, it is moved to the top
 
bool containsGraph (const JKQTPPlotElement *gr) const
 returns true, if the given graph is in this plot
 
void moveGraphTop (const JKQTPPlotElement *gr)
 move the given graph gr to the end of all graphs, so it is drawn

 
void moveGraphBottom (const JKQTPPlotElement *gr)
 move the given graph gr to the bottom of all graphs
 
void moveGraphTop (int idx)
 move the given graph to the top
 
void moveGraphBottom (int idx)
 move the given graph to the top
 
int indexOfGraph (const JKQTPPlotElement *gr) const
 returns the index of the given graph gr in the graphs list, or -1 if it was not found
 
void moveGraphUp (const JKQTPPlotElement *gr)
 move the given graph gr one item up (i.e. it is drawn later/higher in the z-stack)
 
void moveGraphDown (const JKQTPPlotElement *gr)
 move the given graph gr one item down (i.e. it is drawn earlier/lower in the z-stack)
 
void moveGraphUp (int idx)
 move the graph at position idx one item up (i.e. it is drawn later/higher in the z-stack)
 
void moveGraphDown (int idx)
 move the graph at position idx one item down (i.e. it is drawn earlier/lower in the z-stack)
 
template<class TJKQTPGraphContainer >
void addGraphs (const TJKQTPGraphContainer &gr, QVector< size_t > *graphIDsOut=nullptr)
 add a new graphs from a QVector<JKQTPPlotElement*>, QList<JKQTPPlotElement*>, std::vector<JKQTPPlotElement*> ... or any standard-iterateable container with JKQTPPlotElement*-items
 
void modifyGraphs (const std::function< void(JKQTPPlotElement *)> &func)
 apply functor func to all graphs in the plotter. After completing the operation, the graph is updated
 
void sortGraphs (const std::function< bool(const JKQTPPlotElement *, const JKQTPPlotElement *)> &compareLess)
 sort the graphs, using functor compareLess to find whether a first graph shall be before (i.e. less) than a second graph. After completing the operation, the graph is updated
 
bool getGraphsXMinMax (double &minx, double &maxx, double &smallestGreaterZero, const PlotElementPreciate &predicate=allPlotElements())
 get the maximum and minimum x-value over all graphs in the plot
 
bool getGraphsYMinMax (double &miny, double &maxy, double &smallestGreaterZero, const PlotElementPreciate &predicate=allPlotElements())
 get the maximum and minimum y-value over all graphs in the plot
 
void clearGraphs (bool deleteGraphs=true)
 remove all plots
 
void setAllGraphsInvisible ()
 set all graphs in the plotter invisible
 
void setAllGraphsVisible ()
 set all graphs in the plotter visible
 
void setGraphVisible (int i, bool visible=true)
 switch visibility of the i -th graph to visible
 
void setGraphInvisible (int i)
 switch visibility of the i -th graph to visible
 

Drawing Functions

class JKQTPBaseKey
 
class JKQTPMainKey
 
void draw (JKQTPEnhancedPainter &painter, const QRect &rect)
 draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter
 
void draw (JKQTPEnhancedPainter &painter, const QPoint &pos=QPoint(0, 0))
 draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter
 
void drawNonGrid (JKQTPEnhancedPainter &painter, const QRect &rect)
 draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter
 
void drawNonGrid (JKQTPEnhancedPainter &painter, const QPoint &pos=QPoint(0, 0))
 draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter
 
void redrawPlot ()
 emit plotUpdated(), which can be used by e.g. a widget class to update the displayed plot
 
void setEmittingPlotSignalsEnabled (bool __value)
 controls, whether the signals plotUpdated() are emitted
 
bool isEmittingPlotSignalsEnabled () const
 returns, whether the signals plotUpdated() are emitted
 
bool isEmittingSignalsEnabled () const
 returns whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate()
 
void setEmittingSignalsEnabled (bool enabled)
 specifies whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate()
 
int getPlotBorderTop () const
 free space between widget top border and plot top border, this property may be set by the user and is possibly altered by the key positioning algorithm. The altered value is written to internalPlotBorderTop

 
int getPlotBorderLeft () const
 free space between widget left border and plot left border, this property may be set by the user and is possibly altered by the key positioning algorithm. The altered value is written to internalPlotBorderLeft

 
int getPlotBorderBottom () const
 free space between widget bottom border and plot bottom border, this property may be set by the user and is possibly altered by the key positioning algorithm. The altered value is written to internalPlotBorderBottom

 
int getPlotBorderRight () const
 free space between widget right border and plot right border, this property may be set by the user and is possibly altered by the key positioning algorithm. The altered value is written to internalPlotBorderRight

 
bool doesMaintainAspectRatio () const
 returns whether the maintaining of the data aspect ratio is enabled or disabled
 
double getAspectRatio () const
 returns the data aspect ratio, enforced with setMaintainApsectRatio(true)
 
bool doesMaintainAxisAspectRatio () const
 returns whether the maintaining of the axis aspect ratio is enabled or disabled
 
double getAxisAspectRatio () const
 returns the axis aspect ratio, enforced with setMaintainAxisApsectRatio(true)
 
bool isUsingAntiAliasingForSystem () const
 specifies whether to use antialiasing for plotting the coordinate system

 
bool isUsingAntiAliasingForGraphs () const
 specifies whether to use antialiasing for plotting the graphs

 
bool isUsingAntiAliasingForText () const
 specifies whether to use antialiasing when drawing any text

 
QColor getBackgroundColor () const
 color of the background of the plot (widget area) when drawing (to the screen)

 
QColor getExportBackgroundColor () const
 color of the background of the plot (widget area) when exporting

 
QColor getPlotBackgroundColor () const
 color of the plot's background (i.e. of the area within the coordinate axes rectangle)

 
QBrush getBackgroundBrush () const
 color of the background of the plot (widget area) when drawing (to the screen)

 
QBrush getExportBackgroundBrush () const
 color of the background of the plot (widget area) when exporting

 
QBrush getPlotBackgroundBrush () const
 color of the plot's background (i.e. of the area within the coordinate axes rectangle)

 
bool getShowKey () const
 indicates whether to plot a key
 
JKQTPKeyPosition getKeyPosition () const
 key position inside or besides the plot area, see JKQTPKeyPositions for details and examples
 
QColor getDefaultTextColor () const
 default text color in the plot
 
double getDefaultTextSize () const
 default font size in the plot [pt]
 
QString getDefaultTextFontName () const
 default font name in the plot
 
void setFontSizePrintMultiplier (double __value)
 multiplier which is used for font sizes when the plot is exported/printed
 
double getFontSizePrintMultiplier () const
 multiplier which is used for font sizes when the plot is exported/printed
 
void setLineWidthPrintMultiplier (double __value)
 multiplier which is used for linewidths when the plot is exported/printed
 
double getLineWidthPrintMultiplier () const
 multiplier which is used for linewidths when the plot is exported/printed
 
double getFontSizeMultiplier () const
 multiplier for the font size
 
double getLineWidthMultiplier () const
 multiplier or the line widths
 
const JKQTPKeyStylegetMainKeyStyle () const
 retuns the JKQTPKeyStyle to be used for the main key (extracted from JKQTBasePlotterStyle::keyStyle)
 
bool isDebugShowRegionBoxesEnabled () const
 if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the different regions in the plot (border, axes, ...)
 
bool isDebugShowTextBoxesEnabled () const
 if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the extent of text
 
bool isPlotFrameVisible () const
 if true, JKQTBasePlotter will draw a rectangle/frame around the plot
 
QColor getPlotFrameColor () const
 if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this color
 
double getPlotFrameWidth () const
 if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this width [pt]
 
double getPlotFrameRounding () const
 if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot, rounding the corners with this redius (<=0 -> no rounded rectangle) [pt]
 
double getPlotLabelFontSize () const
 the plot label font size [pt]
 
double getPlotLabelOffset () const
 offset of the plot label from the next element of the graph, i.e. below the label [pt].
 
double getPlotLabelTopBorder () const
 offset of the plot label from the top [pt].
 
QString getplotLabelFontName () const
 the plot label font name
 
QColor getPlotLabelColor () const
 the plot label color
 
QString getPlotLabel () const
 the plot label text
 
void setGridPrinting (bool __value)
 indicates whether the grid printing is activated
 
bool getGridPrinting () const
 indicates whether the grid printing is activated
 
void setGridPrintingCurrentX (size_t __value)
 x position of the current graph in grid printing
 
size_t getGridPrintingCurrentX () const
 x position of the current graph in grid printing
 
void setGridPrintingCurrentY (size_t __value)
 y position of the current graph in grid printing
 
size_t getGridPrintingCurrentY () const
 y position of the current graph in grid printing
 
void setGridPrintingCurrentPos (size_t x, size_t y)
 set the x- and y-positions of this JKQTPlotter in the grid-printing grid
 
QString getCurrentSaveDirectory () const
 returns the current directory in which to open SaveAs ... dialogs
 
QString getCurrentFileFormat () const
 return the last file format to use in SaveAs ... dialogs
 
QString getCSVdecimalSeparator () const
 returns the decimal separator used when exporting data to text files
 
QString getCSVcommentInitializer () const
 set the string used to introduce comments in text output when exporting data
 
double getInternalPlotBorderTop () const
 calculated value: free space between widget top border and plot top border, as used to plot the graph
 
double getInternalPlotBorderLeft () const
 calculated value: free space between widget top border and plot top border, as used to plot the graph
 
double getInternalPlotBorderBottom () const
 calculated value: free space between widget top border and plot top border, as used to plot the graph
 
double getInternalPlotBorderRight () const
 calculated value: free space between widget top border and plot top border, as used to plot the graph
 
int getPlotWidth () const
 calculated value: plot width in pixel inside the widget (calculated by calcPlotScaling() from plotBorderLeft, plotBorderRight and widgetWidth)
 
int getPlotHeight () const
 calculated value: plot height in pixel inside the widget (calculated by calcPlotScaling() from plotBorderTop, plotBorderBottom and widgetHeight)
 
JKQTPKeyStylegetMainKeyStyle ()
 retuns the JKQTPKeyStyle to be used for the main key (extracted from JKQTBasePlotterStyle::keyStyle)
 

Plot Data Export

void saveAsCSV (const QString &filename, const QString &decimalSeparator, const QString &commentInitializer)
 save the current plot data as a Comma Separated Values (CSV) file
 
void saveAsSemicolonSV (const QString &filename, const QString &decimalSeparator, const QString &commentInitializer)
 save the current plot data as a Semicolon Separated Values (SSV) file
 
void saveAsTabSV (const QString &filename, const QString &decimalSeparator, const QString &commentInitializer)
 save the current plot data as a Tabulator Separated Values (CSV) file
 
bool saveData (const QString &filename=QString(""), const QString &format=QString(""))
 save the data used for the current plot. The file format is extracted from the file extension (csv, ...)
 
void copyData ()
 copy the data used for the current plot to the clipboard
 
void copyDataMatlab ()
 copy the data used for the current plot to the clipboard as a Matlab script
 
void saveAsCSV (const QString &filename=QString(""))
 save the current plot data as a Comma Separated Values (CSV) file
 
void saveAsSemicolonSV (const QString &filename=QString(""))
 save the current plot data as a Semicolon Separated Values (SSV) file
 
void saveAsTabSV (const QString &filename=QString(""))
 save the current plot data as a Tabulator Separated Values (CSV) file
 
void saveAsDIF (const QString &filename=QString(""))
 save the current plot data as a Data Interchange Format file (see https://en.wikipedia.org/wiki/Data_Interchange_Format).
 
void saveAsSYLK (const QString &filename=QString(""))
 save the current plot data as a SYmbolik LinK (SYLK) spreadsheet file (see https://en.wikipedia.org/wiki/Symbolic_Link_(SYLK) )
 
void saveAsMatlab (const QString &filename=QString(""))
 save the current plot data as a Matlab Script
 
void saveAsGerExcelCSV (const QString &filename=QString(""))
 save the current plot data as a Semicolon Separated Values (CSV) file for german Excel, i.e. with comma as decimal separator
 

Saving/Exporting Plots as Image/Vector Files

bool saveAsPixelImage (const QString &filename=QString(""), bool displayPreview=true, const QByteArray &outputFormat=QByteArray(), const QSize &outputSizeIncrease=QSize(0, 0))
 save the current plot as a pixel image image (PNG ...), if filename is empty a file selection dialog is displayed
 
QImage grabPixelImage (QSize size=QSize(), bool showPreview=false)
 returns a rendering of the current plot as a QImage (pixel image) with the given size
 
void copyPixelImage (bool showPreview=true)
 copy the current plot as a pixel+svg image to the clipboard
 
bool saveAsSVG (const QString &filename=QString(""), bool displayPreview=true)
 save the current plot as a SVG file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed
 
bool saveAsPDF (const QString &filename=QString(""), bool displayPreview=true)
 save the current plot as a PDF file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed
 
bool saveImage (const QString &filename=QString(""), bool displayPreview=true)
 save the current plot as an image file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed. The image format is extracted from the file extension (jpeg, tiff, png, pdf, ...)
 
void beforeExporting ()
 emitted just before exporting the current plot as image, or just before the export preview dialog is shown
 
void afterExporting ()
 emitted just before exporting the current plot as image, or just before the export preview dialog is shown
 

Print Support

void print (QPrinter *printer=nullptr, bool displayPreview=true)
 print the current plot, if printer is nullptr a printer selection dialog is displayed
 
void beforePrinting ()
 emitted just before Printing the current plot as image, or just before the print preview dialog is shown
 
void afterPrinting ()
 emitted just before Printing the current plot as image, or just before the print preview dialog is shown
 

Detailed Description

base class for 2D plotter classes (used by the plotter widget JKQTPlotter)

This class implements basic functionalities for the plotter classes. Those are:

  1. data storage using a JKQTPDatastore object
  2. coordinate transforms
  3. a set of properties for the graphs (colors, widthes ...) and also a system (see getNextStyle() to automatically choose a drawing style for different graphs.
  4. drawing the coordinate axes, grids ... (logarithmic and linear)
  5. saveing and printing the resulting plots

This class is NOT a widget, if you need a plotting widget, use JKQTPlotter. This class may be used to plot using a JKQTPEnhancedPainter.

See also
JKQTPlotter a QWidget class that displays a JKQTBasePlotter plot on a Qt Window.

Data Storage

As already mentioned this class does not provide means to draw graphs, but it contains a basic mechanism to associate data with it. This is imeplemented, using a JKQTPDatastore object together with some convenience access methods. No further data access is implemented and child classes are NOT forced to use this datastore. Hide it if you want. JKQTPlotter shows how to use it. This class implement a graph management, where graphs simply point to a set of columns inside the datastore that contain the actual plot data!

If you call the JKQTBasePlotter::JKQTBasePlotter() constructor with no arguments, it will create an internal datastore object and you can start adding data by using getDatastore(). If you have an external JKQTPDatastore object you can give it as parameter to the constructor or use one of the other methods:

  • useExternalDatastore(): tells the plotter object to use the given external datastore.
  • useAsInternalDatastore(): tells the plotter object to use the given external datastore and treat it as an internal one (i.e. free it when the plotter object ist destroyed.
  • useInternalDatastore(): tells the plotter object to use an internal datastore. A new internal datastore object is generated only if the current datastore is not internal.
  • forceInternalDatastore(): tells the plotter object to use an internal datastore (just like useInternalDatastore() ), but forces the generation of a new datastore, even if the current one is already internal (the current one will be freed in the lather case

Coordinate Systems and Transformations

These topics are discussed in the help for JKQTPCoordinateAxis. There is a set of coordinate transform methods (x2p(), y2p(), p2x(), p2y() which only call the respective methods in xAxis and yAxis objects.

Axis Ticks and Grids

Major Coordinate Axes

JKQTBasePlotter - by default - has two major axes: A horizontal x-axis and a vertical y-axis.

The plotting of coordinate axes and grids, as well as coordinate transforms is done by JKQTPCoordinateAxis descendents (see documentation there).

If you want to set the axis properties, use getXAxis() or getYAxis() to get a pointer to the axis objects which then may be used to set the axis properties.

Secondary Coordinate Axes

In addition a plot may contain secondary axes, as shown below:

You can add additional x-axes using addSecondaryXAxis() and y-axes using addSecondaryYAxis(). These functions return a JKQTPCoordinateAxisRef, which can be used to reference these axes, when calling function like getXAxis() here the default-parameter call getXAxis(JKQTPPrimaryAxis) returns the primary axis (JKQTPPrimaryAxis may be omitted) and calling getXAxis(JKQTPSecondaryAxis) will return the first secondary axis and so on.

In graphs (derived from JKQTPPlotElement) you can use JKQTPPlotElement::setXAxis() and JKQTPPlotElement::setYAxis() with a JKQTPCoordinateAxisRef as parameter to tell plots to use another axis.

Using a JKQTPCoordinateAxisRef instead of a pointer to a JKQTPCoordinateAxis allows to exchange the axes in the plot, while not breaking the graphs.

Here is a code example of how to use secondary axes:

// construct a new x-axis-object
// add it to the plot
auto xAxisRef2=plot.getPlotter()->addSecondaryXAxis(secXAxis);
// ... now you can access it:
plot.getXAxis(xAxisRef2)->setShowZeroAxis(false);
// ... and use it for graphs:
graph2->setXAxis(xAxisRef2);
void setShowZeroAxis(bool __value)
indicates whether to draw a thick axis line at x=0 (zero axis)
base class for horizontal axes, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoo...
Definition jkqtpcoordinateaxes.h:1154
implements a horizontal axis, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoord...
Definition jkqtpcoordinateaxes.h:1221
@ JKQTPPrimaryAxis
Definition jkqtpcoordinateaxes.h:43
See also
addSecondaryXAxis(), addSecondaryYAxis(), getXAxis(), getYAxis()

Appearance & Styling of the Graph

Plot Sizes & Borders

JKQTBasePlotter itself is no QWidget. It is merely tool to represent, manage and draw a graph onto any durface. JKQTPlotter then uses an internal JKQTBasePlotter instance to provide a QWidget.

Still the JKQTBasePlotter needs a way to represent the location of the graph, the graph axes etc. inside a drawing rectangle (of size widgetWidth * widgetHeight ). The plot borders are then offsets to the plot indise that rectangele. This image illustrated the principle:

When the plot is actually drawn, it may happen, that additional elements need to be positioned between the actual coordinate rectangle and the widget worder (e.g. axis labels, ticks, color bars etc.). Therefore this objects manages a set of internally calculated variables that also incorporate those dynamic elements. These are e.g. internalPlotBorderLeft, internalPlotBorderTop, internalPlotBorderRight, ... Their names all start with internal... .

Aspect Ratios

First note that this functionality is only available and activated if both axes are linear!

You can set two different aspect ratios:

So to achieve different effects, use these combinations:

Graph Keys (Legends)

This class provides means to plot a key together with the functions. The plotting is only partially implemented in this base class, and has to be implemented by child classes, as no graph management, that could provide a title for a specific graph, is implemented here. Key Plotting is performed in the plotKey() method. This method basically draws a frame and background and then calls plotKeyContent() to draw the actual contents. The size of the key is determined by a call to getKeyExtent(), while it's position and plotting style is determined by the key_... parameters. If getKeyExtent() returns 0 for height or width, no key is plotted. The key_... parameters are designed to be rather common for any usual kind of key, so any implementation of key should be able to use them to parametrize the output. Note however that additional parameters might be defined in child classes.

As it may be convenient to position the key completely outside the graph this class may change the plotBorders to make the key fit outside SO if you use a keyPosition outside the graph you should NOT keep any space for the key in the margins, as the program will change them to accomodate the size of the key. If you select an inside key position the key will be plotted OVER the graph, i.e. the margins won't be changed Note that the margin change is internal and not visible in the class interface!

There is also a possibility to determine the size of the key automatically, so all text fits in. This is activted by the property keyAutosize ( ). If this is true the function getKeyExtent() has to check the width of every key item and take it into account when calculating the width and height of the key content. By default this feature is switched ON.

Printing, Saving & Exporting

Saving and Printing Graphs

This class implement a set of function to save and print the graphs:

  • print() prints the graph on a QPrinter object
  • saveAsPixelImage() saves the plot into a pixel image file (PNG, TIFF, ... formats, as supported by Qt)
  • saveAsPDF() saves the graph as a PDF file (using the Qt printing engine)
  • saveAsSVG() saves the graph as a SVG file (using the Qt SVG library)
  • saveImage() saves the graph

You can also copy the contents of the plot into the clipboard:

Exporting Graph Data

This class implement a set of function to save the data of the graphs:

  • saveData() saves the data of the plot
  • saveAsCSV() saves the data of the plot as comma separated values
  • saveAsSYLK() saves the data of the plot as SYLK spreadsheet
  • saveAsDIF() saves the data of the plot as data interchange format file
  • saveAsMatlab() saves the data of the plot as a CSV file suitable for Matlab
  • saveAsSemicolonSV() saves the data of the plot as a Semicolon Separated Values (SSV)
  • saveAsTabSV() saves the data of the plot as a Tabulator Separated Values (CSV) file
  • saveAsGerExcelCSV() saves the data of the plot as a Text file (SSV) suitable for german excel, i.e. with comma as decimal separator

You can also copy the graphs' data into the clipboard:

Synchronizing Several Plots

Often a single plot is not sufficient, but several plots need to be aligned with respect to each other:

This can be achieved by putting several JKQTPlotter instances into a Qt Layout. Then you can fill each plot differently and set the x-/y-range of each plot by hand. This method works for simple cases, but has several drawbacks:

  • Due to the independent and automatic layouting of each plot, the axes do not need to be aligned properly
  • When you print the plot, the printing does not know about the layout and the other plots in it. Therefor it will only print the plot itself.
    Printing with grid-printing-mode deactivated

    Printing with grid-printing-mode activated
  • when you zoom/pan in one of the plots (e.g. using the mouse), the other plots will not adapt their axes to match the new area, but especially in cases as in the image above it would be beneficial, that the x-axis of the plot at the bottom follows the x-axis of the plot above etc.

To overcome these limitations, JKQTPlotter (and JKQTBasePlotter) offer an API with which you can declare relations between different plots (one of them is made the master) and you can synchronize the axes of two plots, when zooming (also when calling e.g. zoomToFit() or setXY() ). This API is:

Synchronizing Axis Range & Plot Width

You can synchronize the plot width and axis range between two JKQTPlotter instaces using:

See also
See Example (JKQTPlotter): Laying out Several Plots for an extensive example of the functionality.

Grid Printing/Declaring Relations between Plots

Usually each JKQTPlotter/JKQTBasePlotter prints or exports only itself. But in many cases you might want to add several plots that form a grid layout and also want to export them as one image/print them on one page. To do this, JKQTPlotter/JKQTBasePlotter offers the "grid printing" mode. In this mode, you can declare relations between different JKQTPlotters/JKQTBasePlotters by putting them in a rectangular grid (like in a QGridLayout). then any export/print action will draw all (explicitly) decalred graphs.

The grid printing API is composed of these functions:

See also
See Example (JKQTPlotter): Laying out Several Plots for an extensive example of the functionality.

User Properties

There is a subset of options that describe how the user interacted with the plotter (export/print scaling factors etc, save directories, other export settings, ...). These are not stored/loaded using saveSettings() and loadSettings(), but using saveUserSettings() and loadUserSettings(). These methods MAY (strictly optional and turned off by default) be called by saveSettings() and loadSettings(), if the property userSettigsFilename ( filename for the ini file in which to save the user settings )is set (not-empty). In this case the suer settings are stored/loaded also everytime they are changed by the user or programmatically.

JKQTBasePlotter Usage

JKQTBasePlotter as Basis for JKQTPlotter

Most commonly this invisible plotter class is used as basis for the widget JKQTPlotter.

See also
JKQTPlotter

JKQTBasePlotter Standalone Usage (non-visible class)

It is also possible to use it in a standalone fashion to generate plots without generating a window. Note that the baseplotter class still requires the widgets+gui modules of Qt, because it contains code to e.g. display pint or export preview dialogs!

Here is an example of how to do this (it is taken from the command-line tool Tool (JKQTMathText): Command-Line Utility jkqtplotter_doc_imagegenerator):

First we generate the JKQTBasePlotter object and add some data to the internal JKQTPDatastore

JKQTBasePlotter plot(true);
JKQTPDatastore* ds=plot.getDatastore();
size_t cx=ds->addCopiedColumn(QVector<double>{-1.5,-0.5,0.5,1.5,2.5},"x");
size_t cy=ds->addCopiedColumn(QVector<double>{-0.75,-0.3,-0.05,0.2,0.65},"y");
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
This class manages data columns (with entries of type double ), used by JKQTPlotter/JKQTBasePlotter t...
Definition jkqtpdatastorage.h:282
size_t addCopiedColumn(TIterator first, TIterator last, const QString &name=QString(""))
add one column to the datastore. It will be filled with the values from first ... last
Definition jkqtpdatastorage.h:871

Now we set the range of x/y plot coordinates ...

plot.setXY(-0.8,2.2,-0.5,0.7);

and the size of the widget, i.e. the size of the plot in the windowing system.

plot.setWidgetSize(150,50);

Now we can add graphs to the plotter, e.g.

g->setXColumn(cx);
g->setYColumn(cy);
plot.addGraph(g);
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
This implements xy line plots. This also alows to draw symbols at the data points.
Definition jkqtplines.h:61

Finally we store an image of the plot as PNG-file:

plot.saveAsPixelImage("output.png", false, "png");

Alternatively you can obtain a QImage of the plot using JKQTBasePlotter::grabPixelImage() or copy the image to the clipboard using JKQTBasePlotter::copyPixelImage(). Also storages as PDF and SVG is available via JKQTBasePlotter::saveAsPDF() and JKQTBasePlotter::saveAsSVG().

With simlar code you can also integrate JKQTBasePlotter into your own widgets.

This class is immpleented in a such a way that different instances can be used in different parallel threads, i.e. the class is re-entrant. There are however access to different cached data is synchronized between all threads (i.e. static internal caches are used), which limmits the acheavable parallelization speedup!

See Example (JKQTPlotter): Multi-Threaded (Parallel) Plotting for an example of multi-threaded plotting!

Member Typedef Documentation

◆ AdditionalActionsMap

typedef QMap<QString, QList<QPointer<QAction> > > JKQTBasePlotter::AdditionalActionsMap

◆ AdditionalActionsMapIterator

typedef QMapIterator<QString, QList<QPointer<QAction> > > JKQTBasePlotter::AdditionalActionsMapIterator

◆ GraphsConstIterator

typedef QVector<JKQTPPlotElement*>::const_iterator JKQTBasePlotter::GraphsConstIterator

◆ GraphsIterator

◆ GraphsList

◆ PlotElementPreciate

typedef std::function<bool(const JKQTPPlotElement*)> JKQTBasePlotter::PlotElementPreciate

Functor which can be used as filter predicate for getGraphsXMinMax() or getGraphsYMinMax()

See also
getGraphsXMinMax(), getGraphsYMinMax(), allPlotElements

Member Enumeration Documentation

◆ PlotMarginSide

enum to indicate relative position from a central position

Enumerator
sideLeft 
sideRight 
sideTop 
sideBottom 

◆ PlotMarginUse

used for calculated value:describing what freespace outside the graph area is used for

Enumerator
muOutermost 
muUserBorder 
muPlotTitle 
muKey 
muGraphsOutside 
muAxesOutsideExtend 
muAxesOutside 
muUsesCount 
muInnermost 

◆ SynchronizationDirection

denotes, which axes to synchronize in synchronizeToMaster()

Enumerator
sdXAxis 

x-axis only

sdYAxis 

y-axis only

sdXYAxes 

x- and y-axis

Constructor & Destructor Documentation

◆ JKQTBasePlotter() [1/2]

JKQTBasePlotter::JKQTBasePlotter ( bool  datastore_internal,
QObject *  parent = nullptr,
JKQTPDatastore datast = nullptr 
)
explicit

class constructor

if datastore_internal is true then the constructor will create an internal datastore object. The datastore will be managed (freed) by this class. If datastore_internal is false the class will use the datastore provided in datast as an external datastore. You can modify this later by using useInternalDatastore() and useExternalDatastore().

◆ JKQTBasePlotter() [2/2]

JKQTBasePlotter::JKQTBasePlotter ( )
delete

◆ ~JKQTBasePlotter()

virtual JKQTBasePlotter::~JKQTBasePlotter ( )
virtual

class destructor

Member Function Documentation

◆ addGraph()

size_t JKQTBasePlotter::addGraph ( JKQTPPlotElement gr)
inline

◆ addGraphAtBottom()

size_t JKQTBasePlotter::addGraphAtBottom ( JKQTPPlotElement gr)

add a new graph before all other graphs (i.e. at the top of the list of graphs), if the graph is already in the plot, it is moved to the top

Parameters
grgraph object (of type JKQTPPlotElement) to be added. Note: The JKQTPlotter takes ownership of graph gr .
Note
the added graph is drawn BELOW/BEFORE all other graphs.

◆ addGraphOnTop()

size_t JKQTBasePlotter::addGraphOnTop ( JKQTPPlotElement gr)

add a new graph at the end of the graphs, if the graph is already in the plot, it is moved to the end of the list

Parameters
grgraph object (of type JKQTPPlotElement) to be added. Note: The JKQTPlotter takes ownership of graph gr .
Note
the added graph is drawn ABOVE/AFTER all other graphs.

◆ addGraphs()

template<class TJKQTPGraphContainer >
void JKQTBasePlotter::addGraphs ( const TJKQTPGraphContainer &  gr,
QVector< size_t > *  graphIDsOut = nullptr 
)
inline

add a new graphs from a QVector<JKQTPPlotElement*>, QList<JKQTPPlotElement*>, std::vector<JKQTPPlotElement*> ... or any standard-iterateable container with JKQTPPlotElement*-items

Template Parameters
TJKQTPGraphContainera container type with default C++-sytle iterator interface (i.e. methods begin() and end() and an iterator, which may be moved to the next element with the operator ++ .
Parameters
grContainer of type TJKQTPGraphContainer, which contains the graphs Note: The JKQTPlotter takes ownership of graphs in gr .
[out]graphIDsOutoptional output parameter, the vector will contain the IDs of each graph added to theis plot

◆ addGridPrintingPlotter()

void JKQTBasePlotter::addGridPrintingPlotter ( size_t  x,
size_t  y,
JKQTBasePlotter plotter 
)

add a new plotter for grid printing mode

◆ addSecondaryXAxis()

JKQTPCoordinateAxisRef JKQTBasePlotter::addSecondaryXAxis ( JKQTPHorizontalAxisBase axis)

adds a secondary x-axis

Parameters
axisthe JKQTPHorizontalAxisBase object to add
Returns
a reference to this axis

Usage is simple:

// construct a new x-axis-object
// add it to the plot
auto xAxisRef2=plot.getPlotter()->addSecondaryXAxis(secXAxis);
// ... now you can access it:
plot.getXAxis(xAxisRef2)->setShowZeroAxis(false);
// ... and use it for graphs:
graph2->setXAxis(xAxisRef2);

Here is an example output:

See also
Secondary Coordinate Axes , Example (JKQTPlotter): Secondary Axes

◆ addSecondaryYAxis()

JKQTPCoordinateAxisRef JKQTBasePlotter::addSecondaryYAxis ( JKQTPVerticalAxisBase axis)

adds a secondary y-axis

Parameters
axisthe JKQTPVerticalAxisBase object to add
Returns
a reference to this axis

Usage is simple:

// construct a new y-axis-object
JKQTPVerticalAxisBase* secYAxis=new JKQTPVerticalAxis(plot.getPlotter(), JKQTPPrimaryAxis)
// add it to the plot
auto yAxisRef2=plot.getPlotter()->addSecondaryYAxis(secYAxis);
// ... now you can access it:
plot.getYAxis(yAxisRef2)->setShowZeroAxis(false);
// ... and use it for graphs:
graph2->setYAxis(yAxisRef2);
base class for vertical axes, based on JKQTPCoordinateAxis (for most of documentation: see JKQTPCoord...
Definition jkqtpcoordinateaxes.h:967
implements a vertical axis for use as primary, secondary, ... axis of a JKQTPBasePlotter,...
Definition jkqtpcoordinateaxes.h:1032

Here is an example output:

See also
Secondary Coordinate Axes , Example (JKQTPlotter): Secondary Axes

◆ afterExporting

void JKQTBasePlotter::afterExporting ( )
signal

emitted just before exporting the current plot as image, or just before the export preview dialog is shown

This signal can be used to e.g. modify the plotter settings after an export.

See also
beforeExporting(), beforePrinting(), afterPrinting()

◆ afterPrinting

void JKQTBasePlotter::afterPrinting ( )
signal

emitted just before Printing the current plot as image, or just before the print preview dialog is shown

This signal can be used to e.g. modify the plotter settings after a print.

See also
beforePrinting(), beforeExporting(), afterExporting()

◆ beforeExporting

void JKQTBasePlotter::beforeExporting ( )
signal

emitted just before exporting the current plot as image, or just before the export preview dialog is shown

This signal can be used to e.g. modify the plotter settings before an export.

See also
afterExporting(), beforePrinting(), afterPrinting()

◆ beforePlotScalingRecalculate

void JKQTBasePlotter::beforePlotScalingRecalculate ( )
signal

emitted before the plot scaling has been recalculated

◆ beforePrinting

void JKQTBasePlotter::beforePrinting ( )
signal

emitted just before Printing the current plot as image, or just before the print preview dialog is shown

This signal can be used to e.g. modify the plotter settings before a print.

See also
afterPrinting(), beforeExporting(), afterExporting()

◆ beginGraphs() [1/2]

GraphsIterator JKQTBasePlotter::beginGraphs ( )
inline

returns an iterator to the first graph

Note
If you modify the graphs or change their position, a replot may not happen, so call redrawPlot() if the plotter is e.g. embedded in a visible widget to cause a redrawing of the plot!

◆ beginGraphs() [2/2]

GraphsConstIterator JKQTBasePlotter::beginGraphs ( ) const
inline

returns a const iterator to the first graph

◆ calcPlotMarginRect()

QRectF JKQTBasePlotter::calcPlotMarginRect ( PlotMarginUse  use,
PlotMarginSide  side 
) const
protected

calculate the rectangle to be used for a given PlotMarginUse on the indicated side of the plot

This function evaluates the data in internalPlotMargins also using the other properties known in this class. Basically it therefore defines the ordering and interpretation of PlotMarginUse.

See also
internalPlotMargins

◆ calcPlotRect()

QRectF JKQTBasePlotter::calcPlotRect ( ) const
protected

calculate the rectangle of the plot (excluding all margins)

◆ calcPlotScaling()

void JKQTBasePlotter::calcPlotScaling ( JKQTPEnhancedPainter painter)
protected

calculate the scaling and offset values from axis min/max values

◆ cbeginGraphs()

GraphsConstIterator JKQTBasePlotter::cbeginGraphs ( ) const
inline

returns a const iterator to the first graph

◆ cendGraphs()

GraphsConstIterator JKQTBasePlotter::cendGraphs ( ) const
inline

returns a const iterator behind the last graph

◆ clearGraphs

void JKQTBasePlotter::clearGraphs ( bool  deleteGraphs = true)
slot

remove all plots

Parameters
deleteGraphsif set true (default) the graph objects will also be deleted

◆ clearGridPrintingPlotters()

void JKQTBasePlotter::clearGridPrintingPlotters ( )

clear all additional plotters for grid printing mode

◆ containsGraph()

bool JKQTBasePlotter::containsGraph ( const JKQTPPlotElement gr) const

returns true, if the given graph is in this plot

◆ copyData

void JKQTBasePlotter::copyData ( )
slot

copy the data used for the current plot to the clipboard

copies data as tab separated data with the system-decimal point.

◆ copyDataMatlab

void JKQTBasePlotter::copyDataMatlab ( )
slot

copy the data used for the current plot to the clipboard as a Matlab script

example output:

% data from columne 1 ('x')
x = [ 0 0.251327 0.502655 ... ];
% data from columne 2 ('y')
y = [ 0 0.24869 0.481754 ... ];
See also
saveAsMatlab()

◆ copyPixelImage

void JKQTBasePlotter::copyPixelImage ( bool  showPreview = true)
slot

copy the current plot as a pixel+svg image to the clipboard

◆ correctXYRangeForAspectRatio()

void JKQTBasePlotter::correctXYRangeForAspectRatio ( double &  xminn,
double &  xmaxx,
double &  yminn,
double &  ymaxx 
) const

takes a new axis range xminn ... xmaxx and yminn ... ymaxx and corrects the values to match the currently set axisAspectRatio

This function is used by setXY(), setX(), setY().

See also
axisAspectRatio, setXY(), setX(), setY()

◆ deleteGraph() [1/2]

void JKQTBasePlotter::deleteGraph ( JKQTPPlotElement gr,
bool  deletegraph = true 
)

remove the given graph, if it is contained

◆ deleteGraph() [2/2]

void JKQTBasePlotter::deleteGraph ( size_t  i,
bool  deletegraph = true 
)

remove the i-th graph

◆ deregisterAdditionalAction()

void JKQTBasePlotter::deregisterAdditionalAction ( QAction *  act)

this function deregisters an additional action, previously added with registerAdditionalAction()

See also
registerAdditionalAction()

◆ deregisterPaintDeviceAdapter()

static void JKQTBasePlotter::deregisterPaintDeviceAdapter ( JKQTPPaintDeviceAdapter adapter)
static

de-register a JKQTPPaintDeviceAdapter from JKQTBasePlotter/JKQTPlotter

◆ deregisterSaveDataAdapter()

static bool JKQTBasePlotter::deregisterSaveDataAdapter ( JKQTPSaveDataAdapter adapter)
static

de-register a JKQTPSaveDataAdapter from JKQTPlotter/JKQTBasePlotter

◆ didot2px() [1/3]

double JKQTBasePlotter::didot2px ( double  pt,
double  dpi 
) const
inline

returns the given size in Didot points (0.376 mm) to pixels (with given dots per inch)

◆ didot2px() [2/3]

double JKQTBasePlotter::didot2px ( double  pt,
JKQTPEnhancedPainter painter 
) const
inline

returns the given size in Didot points (0.376 mm) to pixels (with dpi from painter)

◆ didot2px() [3/3]

double JKQTBasePlotter::didot2px ( JKQTPEnhancedPainter painter,
double  pt 
) const
inline

returns the given size in Didot points (0.376 mm) to pixels (with dpi from painter)

◆ doesMaintainAspectRatio()

bool JKQTBasePlotter::doesMaintainAspectRatio ( ) const

returns whether the maintaining of the data aspect ratio is enabled or disabled

See also
aspectRatio

◆ doesMaintainAxisAspectRatio()

bool JKQTBasePlotter::doesMaintainAxisAspectRatio ( ) const

returns whether the maintaining of the axis aspect ratio is enabled or disabled

See also
axisAspectRatio

◆ draw() [1/2]

void JKQTBasePlotter::draw ( JKQTPEnhancedPainter painter,
const QPoint &  pos = QPoint(0, 0) 
)

draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter

Parameters
painterJKQTPEnhancedPainter to which the plot should be drawn
poswhere to plot the painter (left-top corner)

◆ draw() [2/2]

void JKQTBasePlotter::draw ( JKQTPEnhancedPainter painter,
const QRect &  rect 
)

draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter

Parameters
painterJKQTPEnhancedPainter to which the plot should be drawn
rectrectangle to plot into

◆ drawGraphs()

void JKQTBasePlotter::drawGraphs ( JKQTPEnhancedPainter painter)
protected

plot the graphs in the order they appear in the list graphs, i.e. initially the order of the addGraph() calls. So the graph at the end of the list is drawn ON TOP.

◆ drawKey()

void JKQTBasePlotter::drawKey ( JKQTPEnhancedPainter painter)
protected

plot a key

◆ drawNonGrid() [1/2]

void JKQTBasePlotter::drawNonGrid ( JKQTPEnhancedPainter painter,
const QPoint &  pos = QPoint(0, 0) 
)

draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter

Parameters
painterJKQTPEnhancedPainter to which the plot should be drawn
poswhere to plot the painter (left-top corner)

◆ drawNonGrid() [2/2]

void JKQTBasePlotter::drawNonGrid ( JKQTPEnhancedPainter painter,
const QRect &  rect 
)

draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter

Parameters
painterJKQTPEnhancedPainter to which the plot should be drawn
rectrectangle to plot into

◆ drawPlot()

void JKQTBasePlotter::drawPlot ( JKQTPEnhancedPainter painter)
protected

paints the plot onto the given JKQTPEnhancedPainter object

Parameters
painterJKQTPEnhancedPainter to draw on

◆ drawPlotLabel()

void JKQTBasePlotter::drawPlotLabel ( JKQTPEnhancedPainter painter)
protected

plot the plot label

◆ drawSystemGrid()

void JKQTBasePlotter::drawSystemGrid ( JKQTPEnhancedPainter painter)
protected

plot the grid

◆ drawSystemXAxis()

void JKQTBasePlotter::drawSystemXAxis ( JKQTPEnhancedPainter painter)
protected

plot the x coordinate axis (incl. labels)

◆ drawSystemYAxis()

void JKQTBasePlotter::drawSystemYAxis ( JKQTPEnhancedPainter painter)
protected

plot the x coordinate axis (incl. labels)

◆ enableDebugShowRegionBoxes

void JKQTBasePlotter::enableDebugShowRegionBoxes ( bool  enabled = true)
slot

if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the different regions in the plot (border, axes, ...)

See also
JKQTBasePlotterStyle::debugShowRegionBoxes, isDebugShowRegionBoxesEnabled()

◆ enableDebugShowTextBoxes

void JKQTBasePlotter::enableDebugShowTextBoxes ( bool  enabled = true)
slot

if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the extent of text in the plot

See also
JKQTBasePlotterStyle::debugShowTextBoxes, isDebugShowRegionTextEnabled()

◆ endGraphs() [1/2]

GraphsIterator JKQTBasePlotter::endGraphs ( )
inline

returns an iterator behind the last graph

Note
If you modify the graphs or change their position, a replot may not happen, so call redrawPlot() if the plotter is e.g. embedded in a visible widget to cause a redrawing of the plot!

◆ endGraphs() [2/2]

GraphsConstIterator JKQTBasePlotter::endGraphs ( ) const
inline

returns a const iterator behind the last graph

◆ exportpreview()

bool JKQTBasePlotter::exportpreview ( QSizeF  pageSize,
bool  unitIsMM = false 
)
protected

show the export preview window for a given page size pageSize, either in pixels (unitIsMM ==false ) or in millimeters (unitIsMM ==true )

◆ exportpreviewPaintRequested

void JKQTBasePlotter::exportpreviewPaintRequested ( JKQTPEnhancedPainter painter,
QSize  size 
)
protectedslot

internal function for export preview

◆ forceInternalDatastore()

void JKQTBasePlotter::forceInternalDatastore ( )

tells the plotter object to use an internal datastore (just like useInternalDatastore() ), but forces the generation of a new datastore, even if the current one is already internal (the current one will be freed in the lather case

◆ getAbsoluteXMax()

double JKQTBasePlotter::getAbsoluteXMax ( ) const

returns the absolute x-axis max of the primary x-axis This is the highest allowed value the the axis min/max.

See also
JKQTPCoordinateAxis::getAbsoluteMax()

◆ getAbsoluteXMin()

double JKQTBasePlotter::getAbsoluteXMin ( ) const

returns the absolute x-axis min of the primary x-axis. This is the lowest allowed value the the axis min/max.

See also
JKQTPCoordinateAxis::getAbsoluteMin()

◆ getAbsoluteYMax()

double JKQTBasePlotter::getAbsoluteYMax ( ) const

returns the absolute y-axis max of the primary y-axis This is the highest allowed value the the axis min/max.

See also
JKQTPCoordinateAxis::getAbsoluteMax()

◆ getAbsoluteYMin()

double JKQTBasePlotter::getAbsoluteYMin ( ) const

returns the absolute y-axis min of the primary y-axis This is the lowest allowed value the the axis min/max.

See also
JKQTPCoordinateAxis::getAbsoluteMin()

◆ getActionCopyData()

QAction * JKQTBasePlotter::getActionCopyData ( ) const

QAction which triggers copying of the data to the clipboard.

◆ getActionCopyMatlab()

QAction * JKQTBasePlotter::getActionCopyMatlab ( ) const

QAction which triggers copying of the data to the clipboard in Matlab format.

◆ getActionCopyPixelImage()

QAction * JKQTBasePlotter::getActionCopyPixelImage ( ) const

QAction which triggers copying of the image to the clipboard.

◆ getActionPrint()

QAction * JKQTBasePlotter::getActionPrint ( ) const

QAction which triggers the printing.

◆ getActionSaveCSV()

QAction * JKQTBasePlotter::getActionSaveCSV ( ) const

QAction which triggers the saving as CSV (data only)

◆ getActionSaveData()

QAction * JKQTBasePlotter::getActionSaveData ( ) const

QAction which triggers saving of the data used for the plot.

◆ getActionSavePDF()

QAction * JKQTBasePlotter::getActionSavePDF ( ) const

QAction which triggers the saving as PDF.

◆ getActionSavePix()

QAction * JKQTBasePlotter::getActionSavePix ( ) const

QAction which triggers the saving as pixel image.

◆ getActionSavePlot()

QAction * JKQTBasePlotter::getActionSavePlot ( ) const

QAction which triggers saving of the plot as an image.

◆ getActionSaveSVG()

QAction * JKQTBasePlotter::getActionSaveSVG ( ) const

QAction which triggers the saving as Scalable Vector Graphics (SVG)

◆ getActionShowPlotData()

QAction * JKQTBasePlotter::getActionShowPlotData ( ) const

QAction to show a table with all the plot data in the datastore.

◆ getActionZoomAll()

QAction * JKQTBasePlotter::getActionZoomAll ( ) const

QAction which triggers zoom all.

◆ getActionZoomIn()

QAction * JKQTBasePlotter::getActionZoomIn ( ) const

QAction which triggers zoom in.

◆ getActionZoomOut()

QAction * JKQTBasePlotter::getActionZoomOut ( ) const

QAction which triggers zoom out.

◆ getAspectRatio()

double JKQTBasePlotter::getAspectRatio ( ) const

returns the data aspect ratio, enforced with setMaintainApsectRatio(true)

See also
aspectRatio

◆ getAvailableXAxisRefs()

QSet< JKQTPCoordinateAxisRef > JKQTBasePlotter::getAvailableXAxisRefs ( bool  includePrimary = false) const

returns the set of available x-axes (including the primary, if true is given as parameter)

◆ getAvailableYAxisRefs()

QSet< JKQTPCoordinateAxisRef > JKQTBasePlotter::getAvailableYAxisRefs ( bool  includePrimary = false) const

returns the set of available y-axes (including the primary, if true is given as parameter)

◆ getAxes() [1/2]

QList< JKQTPCoordinateAxis * > JKQTBasePlotter::getAxes ( bool  includePrimaries = true)

returns all available x- or y-axes

◆ getAxes() [2/2]

QList< const JKQTPCoordinateAxis * > JKQTBasePlotter::getAxes ( bool  includePrimaries = true) const

returns all available x- or y-axes

◆ getAxisAspectRatio()

double JKQTBasePlotter::getAxisAspectRatio ( ) const

returns the axis aspect ratio, enforced with setMaintainAxisApsectRatio(true)

See also
axisAspectRatio

◆ getBackgroundBrush()

QBrush JKQTBasePlotter::getBackgroundBrush ( ) const

color of the background of the plot (widget area) when drawing (to the screen)


◆ getBackgroundColor()

QColor JKQTBasePlotter::getBackgroundColor ( ) const

color of the background of the plot (widget area) when drawing (to the screen)


◆ getCSVcommentInitializer()

QString JKQTBasePlotter::getCSVcommentInitializer ( ) const

set the string used to introduce comments in text output when exporting data

◆ getCSVdecimalSeparator()

QString JKQTBasePlotter::getCSVdecimalSeparator ( ) const

returns the decimal separator used when exporting data to text files

◆ getCurrentFileFormat()

QString JKQTBasePlotter::getCurrentFileFormat ( ) const

return the last file format to use in SaveAs ... dialogs

◆ getCurrentPlotterStyle()

const JKQTBasePlotterStyle & JKQTBasePlotter::getCurrentPlotterStyle ( ) const

◆ getCurrentSaveDirectory()

QString JKQTBasePlotter::getCurrentSaveDirectory ( ) const

returns the current directory in which to open SaveAs ... dialogs

◆ getDataColumnsByUser()

QSet< int > JKQTBasePlotter::getDataColumnsByUser ( )
protected

◆ getDataColumnsByUserCheckAll

void JKQTBasePlotter::getDataColumnsByUserCheckAll ( )
protectedslot

internal function for getDataColumnsByUser()

◆ getDataColumnsByUserCheckNone

void JKQTBasePlotter::getDataColumnsByUserCheckNone ( )
protectedslot

internal function for getDataColumnsByUser()

◆ getDataColumnsByUserComboBoxSelected

void JKQTBasePlotter::getDataColumnsByUserComboBoxSelected ( const QString &  name)
protectedslot

internal function for getDataColumnsByUser()

◆ getDataColumnsByUserItemChanged

void JKQTBasePlotter::getDataColumnsByUserItemChanged ( QListWidgetItem *  widgetitem)
protectedslot

internal function for getDataColumnsByUser()

◆ getDataColumnsByUserSave

void JKQTBasePlotter::getDataColumnsByUserSave ( )
protectedslot

internal function for getDataColumnsByUser()

◆ getDatastore() [1/2]

JKQTPDatastore * JKQTBasePlotter::getDatastore ( )
inline

returns a pointer to the datastore used by this object

◆ getDatastore() [2/2]

const JKQTPDatastore * JKQTBasePlotter::getDatastore ( ) const
inline

returns a pointer to the datastore used by this object

◆ getDefaultTextColor()

QColor JKQTBasePlotter::getDefaultTextColor ( ) const

default text color in the plot

◆ getDefaultTextFontName()

QString JKQTBasePlotter::getDefaultTextFontName ( ) const

default font name in the plot

◆ getDefaultTextSize()

double JKQTBasePlotter::getDefaultTextSize ( ) const

default font size in the plot [pt]

◆ getExportBackgroundBrush()

QBrush JKQTBasePlotter::getExportBackgroundBrush ( ) const

color of the background of the plot (widget area) when exporting


◆ getExportBackgroundColor()

QColor JKQTBasePlotter::getExportBackgroundColor ( ) const

color of the background of the plot (widget area) when exporting


◆ getFontSizeMultiplier()

double JKQTBasePlotter::getFontSizeMultiplier ( ) const

multiplier for the font size

◆ getFontSizePrintMultiplier()

double JKQTBasePlotter::getFontSizePrintMultiplier ( ) const

multiplier which is used for font sizes when the plot is exported/printed

◆ getGraph() [1/2]

JKQTPPlotElement * JKQTBasePlotter::getGraph ( size_t  i)

returns description of i'th graph

Note
If you modify the returned graph, a replot may not happen, so call redrawPlot() if the plotter is e.g. embedded in a visible widget to cause a redrawing of the plot!

◆ getGraph() [2/2]

const JKQTPPlotElement * JKQTBasePlotter::getGraph ( size_t  i) const

returns description of i'th graph

◆ getGraphCount()

size_t JKQTBasePlotter::getGraphCount ( ) const

returns the number of graphs

◆ getGraphs() [1/2]

GraphsList & JKQTBasePlotter::getGraphs ( )
inline

returns a list of all graphs

Note
If you modify the graphs or change their position, a replot may not happen, so call redrawPlot() if the plotter is e.g. embedded in a visible widget to cause a redrawing of the plot!

◆ getGraphs() [2/2]

const GraphsList & JKQTBasePlotter::getGraphs ( ) const
inline

returns a const list of all graphs

◆ getGraphsXMinMax()

bool JKQTBasePlotter::getGraphsXMinMax ( double &  minx,
double &  maxx,
double &  smallestGreaterZero,
const PlotElementPreciate predicate = allPlotElements() 
)

get the maximum and minimum x-value over all graphs in the plot

Parameters
[out]minxsmallest x value
[out]maxxlargest x value
[out]smallestGreaterZerosmallest data point which is >0 (needed for scaling of logarithmic axes)
predicatea PlotElementPreciate, which can be used to limit the JKQTPPlotElement to be evaluated
Returns
true if at least one matching graph was found and evaluated succcessfully

The result is given in the two parameters which are call-by-reference parameters!

◆ getGraphsYMinMax()

bool JKQTBasePlotter::getGraphsYMinMax ( double &  miny,
double &  maxy,
double &  smallestGreaterZero,
const PlotElementPreciate predicate = allPlotElements() 
)

get the maximum and minimum y-value over all graphs in the plot

Parameters
[out]minysmallest y value
[out]maxylargest y value
[out]smallestGreaterZerosmallest data point which is >0 (needed for scaling of logarithmic axes)
predicatea PlotElementPreciate, which can be used to limit the JKQTPPlotElement to be evaluated
Returns
true if at least one matching graph was found and evaluated succcessfully

The result is given in the two parameters which are call-by-reference parameters!

◆ getGridPrinting()

bool JKQTBasePlotter::getGridPrinting ( ) const

indicates whether the grid printing is activated

See also
Grid Printing/Declaring Relations between Plots

◆ getGridPrintingCurrentX()

size_t JKQTBasePlotter::getGridPrintingCurrentX ( ) const

x position of the current graph in grid printing

See also
Grid Printing/Declaring Relations between Plots

◆ getGridPrintingCurrentY()

size_t JKQTBasePlotter::getGridPrintingCurrentY ( ) const

y position of the current graph in grid printing

See also
Grid Printing/Declaring Relations between Plots

◆ getHeight()

int JKQTBasePlotter::getHeight ( )

gets the width of the plot widget

◆ getInternalPlotBorderBottom()

double JKQTBasePlotter::getInternalPlotBorderBottom ( ) const
inline

calculated value: free space between widget top border and plot top border, as used to plot the graph

Note
This property is an intermediate storage for calculated values. Do not change directly!

◆ getInternalPlotBorderLeft()

double JKQTBasePlotter::getInternalPlotBorderLeft ( ) const
inline

calculated value: free space between widget top border and plot top border, as used to plot the graph

Note
This property is an intermediate storage for calculated values. Do not change directly!

◆ getInternalPlotBorderRight()

double JKQTBasePlotter::getInternalPlotBorderRight ( ) const
inline

calculated value: free space between widget top border and plot top border, as used to plot the graph

Note
This property is an intermediate storage for calculated values. Do not change directly!

◆ getInternalPlotBorderTop()

double JKQTBasePlotter::getInternalPlotBorderTop ( ) const
inline

calculated value: free space between widget top border and plot top border, as used to plot the graph

Note
This property is an intermediate storage for calculated values. Do not change directly!

◆ getKeyPosition()

JKQTPKeyPosition JKQTBasePlotter::getKeyPosition ( ) const

key position inside or besides the plot area, see JKQTPKeyPositions for details and examples

◆ getLineWidthMultiplier()

double JKQTBasePlotter::getLineWidthMultiplier ( ) const

multiplier or the line widths

◆ getLineWidthPrintMultiplier()

double JKQTBasePlotter::getLineWidthPrintMultiplier ( ) const

multiplier which is used for linewidths when the plot is exported/printed

◆ getLstAdditionalPlotterActions()

AdditionalActionsMap JKQTBasePlotter::getLstAdditionalPlotterActions ( ) const

this list contains additional actions, that can be registered by registerAdditionalAction(). They are shown in the context menu only and are e.g. used to display "save image data" actions. Each action may be in a category (key of map), which is displayed as a submenu of the context-menu!

◆ getMainKey() [1/2]

JKQTPBaseKey * JKQTBasePlotter::getMainKey ( )

retuns the main key object

◆ getMainKey() [2/2]

const JKQTPBaseKey * JKQTBasePlotter::getMainKey ( ) const

retuns the main key object

◆ getMainKeyStyle() [1/2]

JKQTPKeyStyle & JKQTBasePlotter::getMainKeyStyle ( )
protected

retuns the JKQTPKeyStyle to be used for the main key (extracted from JKQTBasePlotterStyle::keyStyle)

◆ getMainKeyStyle() [2/2]

const JKQTPKeyStyle & JKQTBasePlotter::getMainKeyStyle ( ) const

retuns the JKQTPKeyStyle to be used for the main key (extracted from JKQTBasePlotterStyle::keyStyle)

◆ getMasterSynchronizeHeight()

bool JKQTBasePlotter::getMasterSynchronizeHeight ( ) const

synchronize plot height with masterPlotterY

◆ getMasterSynchronizeWidth()

bool JKQTBasePlotter::getMasterSynchronizeWidth ( ) const

synchronize plot width with masterPlotterX

◆ getMathText() [1/2]

JKQTMathText * JKQTBasePlotter::getMathText ( )

returns the internal JKQTMathText, used to render text with LaTeX markup

◆ getMathText() [2/2]

const JKQTMathText * JKQTBasePlotter::getMathText ( ) const

returns the internal JKQTMathText, used to render text with LaTeX markup

◆ getNextStyle()

int JKQTBasePlotter::getNextStyle ( )

gets the next unused style id, i.e. the smalles number >=0 which is not contained in usedStyles

◆ getPaintMagnification()

double JKQTBasePlotter::getPaintMagnification ( ) const
protected

this is an internal property that is used by the export/print system to control the "magnification". Usually this is 1.0 but if set !=1.0, it is used to scale the widgetWidth and widgetHeight before painting!

◆ getPlotBackgroundBrush()

QBrush JKQTBasePlotter::getPlotBackgroundBrush ( ) const

color of the plot's background (i.e. of the area within the coordinate axes rectangle)


◆ getPlotBackgroundColor()

QColor JKQTBasePlotter::getPlotBackgroundColor ( ) const

color of the plot's background (i.e. of the area within the coordinate axes rectangle)


◆ getPlotBorderBottom()

int JKQTBasePlotter::getPlotBorderBottom ( ) const

free space between widget bottom border and plot bottom border, this property may be set by the user and is possibly altered by the key positioning algorithm. The altered value is written to internalPlotBorderBottom

See also
JKQTBasePlotter::setBorder(), Plot Sizes & Borders

◆ getPlotBorderLeft()

int JKQTBasePlotter::getPlotBorderLeft ( ) const

free space between widget left border and plot left border, this property may be set by the user and is possibly altered by the key positioning algorithm. The altered value is written to internalPlotBorderLeft

See also
JKQTBasePlotter::setBorder(), Plot Sizes & Borders

◆ getPlotBorderRight()

int JKQTBasePlotter::getPlotBorderRight ( ) const

free space between widget right border and plot right border, this property may be set by the user and is possibly altered by the key positioning algorithm. The altered value is written to internalPlotBorderRight

See also
JKQTBasePlotter::setBorder(), Plot Sizes & Borders

◆ getPlotBorderTop()

int JKQTBasePlotter::getPlotBorderTop ( ) const

free space between widget top border and plot top border, this property may be set by the user and is possibly altered by the key positioning algorithm. The altered value is written to internalPlotBorderTop

See also
JKQTBasePlotter::setBorder(), Plot Sizes & Borders

◆ getPlotFrameColor()

QColor JKQTBasePlotter::getPlotFrameColor ( ) const

if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this color

◆ getPlotFrameRounding()

double JKQTBasePlotter::getPlotFrameRounding ( ) const

if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot, rounding the corners with this redius (<=0 -> no rounded rectangle) [pt]

◆ getPlotFrameWidth()

double JKQTBasePlotter::getPlotFrameWidth ( ) const

if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this width [pt]

◆ getPlotHeight()

int JKQTBasePlotter::getPlotHeight ( ) const
inline

calculated value: plot height in pixel inside the widget (calculated by calcPlotScaling() from plotBorderTop, plotBorderBottom and widgetHeight)

See also
Plot Sizes & Borders

◆ getPlotLabel()

QString JKQTBasePlotter::getPlotLabel ( ) const

the plot label text

◆ getPlotLabelColor()

QColor JKQTBasePlotter::getPlotLabelColor ( ) const

the plot label color

◆ getplotLabelFontName()

QString JKQTBasePlotter::getplotLabelFontName ( ) const

the plot label font name

◆ getPlotLabelFontSize()

double JKQTBasePlotter::getPlotLabelFontSize ( ) const

the plot label font size [pt]

◆ getPlotLabelOffset()

double JKQTBasePlotter::getPlotLabelOffset ( ) const

offset of the plot label from the next element of the graph, i.e. below the label [pt].

See also
plotLabelTopBorder for spacing above

◆ getPlotLabelTopBorder()

double JKQTBasePlotter::getPlotLabelTopBorder ( ) const

offset of the plot label from the top [pt].

See also
plotLabelOffset for spacing between label and graph

◆ getPlotsModel() [1/2]

JKQTPGraphsModel * JKQTBasePlotter::getPlotsModel ( )
inline

returns model representing all Plots in this plotter and showing their visible/invisible state

◆ getPlotsModel() [2/2]

const JKQTPGraphsModel * JKQTBasePlotter::getPlotsModel ( ) const
inline

returns model representing all Plots in this plotter and showing their visible/invisible state

◆ getPlotStyle()

JKQTPPen JKQTBasePlotter::getPlotStyle ( int  i,
JKQTPPlotStyleType  type = JKQTPPlotStyleType::Default 
) const

returns a QPen object for the i-th plot style

◆ getPlotWidth()

int JKQTBasePlotter::getPlotWidth ( ) const
inline

calculated value: plot width in pixel inside the widget (calculated by calcPlotScaling() from plotBorderLeft, plotBorderRight and widgetWidth)

See also
Plot Sizes & Borders

◆ getPrintMagnification()

double JKQTBasePlotter::getPrintMagnification ( ) const
protected

◆ getShowKey()

bool JKQTBasePlotter::getShowKey ( ) const

indicates whether to plot a key

◆ getTextSizeDetail() [1/4]

JKQTMathTextNodeSize JKQTBasePlotter::getTextSizeDetail ( const QFont &  fm,
const QString &  text,
QPainter &  painter 
)

calculates a JKQTMathTextNodeSize for the given string text if it would be drawn on painter with font fm

◆ getTextSizeDetail() [2/4]

void JKQTBasePlotter::getTextSizeDetail ( const QFont &  fm,
const QString &  text,
QPainter &  painter,
double &  width,
double &  ascent,
double &  descent,
double &  strikeoutPos 
)

calculates a text-size details for the given string text if it would be drawn on painter with font fm

◆ getTextSizeDetail() [3/4]

JKQTMathTextNodeSize JKQTBasePlotter::getTextSizeDetail ( const QString &  fontName,
double  fontSize,
const QString &  text,
QPainter &  painter 
)

calculates a JKQTMathTextNodeSize for the given string text if it would be drawn on painter with font fontName

◆ getTextSizeDetail() [4/4]

void JKQTBasePlotter::getTextSizeDetail ( const QString &  fontName,
double  fontSize,
const QString &  text,
QPainter &  painter,
double &  width,
double &  ascent,
double &  descent,
double &  strikeoutPos 
)

calculates a text-size details for the given string text if it would be drawn on painter with font fontName and font size fontSize

◆ getTextSizeSize() [1/2]

QSizeF JKQTBasePlotter::getTextSizeSize ( const QFont &  fm,
const QString &  text,
QPainter &  painter 
)

calculates a size of the given string text if it would be drawn on painter with font fm

◆ getTextSizeSize() [2/2]

QSizeF JKQTBasePlotter::getTextSizeSize ( const QString &  fontName,
double  fontSize,
const QString &  text,
QPainter &  painter 
)

calculates a size of the given string text if it would be drawn on painter with font fontName and font size fontSize

◆ getUserSettigsFilename

QString JKQTBasePlotter::getUserSettigsFilename ( ) const
slot

◆ getUserSettigsPrefix

QString JKQTBasePlotter::getUserSettigsPrefix ( ) const
slot

◆ getWidth()

int JKQTBasePlotter::getWidth ( )

gets the width of the plot widget

◆ getXAxes()

QMap< JKQTPCoordinateAxisRef, JKQTPHorizontalAxisBase * > JKQTBasePlotter::getXAxes ( bool  includePrimary = true)

returns all available x-axes

◆ getXAxis() [1/2]

JKQTPHorizontalAxisBase * JKQTBasePlotter::getXAxis ( JKQTPCoordinateAxisRef  axis = JKQTPPrimaryAxis)

returns the x-axis objet of the plot

See also
Axis Ticks and Grids

◆ getXAxis() [2/2]

const JKQTPHorizontalAxisBase * JKQTBasePlotter::getXAxis ( JKQTPCoordinateAxisRef  axis = JKQTPPrimaryAxis) const

returns the x-axis objet of the plot

See also
Axis Ticks and Grids

◆ getXMax()

double JKQTBasePlotter::getXMax ( ) const

returns the current x-axis max of the primary x-axis

See also
JKQTPCoordinateAxis::getMax()

◆ getXMin()

double JKQTBasePlotter::getXMin ( ) const

returns the current x-axis min of the primary x-axis

See also
JKQTPCoordinateAxis::getMin()

◆ getYAxes()

QMap< JKQTPCoordinateAxisRef, JKQTPVerticalAxisBase * > JKQTBasePlotter::getYAxes ( bool  includePrimary = true)

returns all available y-axes

◆ getYAxis() [1/2]

JKQTPVerticalAxisBase * JKQTBasePlotter::getYAxis ( JKQTPCoordinateAxisRef  axis = JKQTPPrimaryAxis)

returns the y-axis objet of the plot

See also
Axis Ticks and Grids

◆ getYAxis() [2/2]

const JKQTPVerticalAxisBase * JKQTBasePlotter::getYAxis ( JKQTPCoordinateAxisRef  axis = JKQTPPrimaryAxis) const

returns the y-axis objet of the plot

See also
Axis Ticks and Grids

◆ getYMax()

double JKQTBasePlotter::getYMax ( ) const

returns the current y-axis max of the primary y-axis

See also
JKQTPCoordinateAxis::getMax()

◆ getYMin()

double JKQTBasePlotter::getYMin ( ) const

returns the current y-axis min of the primary y-axis

See also
JKQTPCoordinateAxis::getMin()

◆ grabPixelImage

QImage JKQTBasePlotter::grabPixelImage ( QSize  size = QSize(),
bool  showPreview = false 
)
slot

returns a rendering of the current plot as a QImage (pixel image) with the given size

See also
saveAsPixelImage(), copyPixelImage()

◆ gridPaint()

void JKQTBasePlotter::gridPaint ( JKQTPEnhancedPainter painter,
QSizeF  pageRect,
bool  scaleIfTooLarge = true,
bool  scaleIfTooSmall = true 
)
protected

simply calls paintPlot() if grid printing mode is deactivated and prints the graph grid otherwise pageRect is used to determine the size of the page to draw on. If this does not coincide with the widget extents this function calculates a scaling factor so the graphs fit onto the page. This is especially usefull when printing!

Parameters
painterJKQTPEnhancedPainter to draw on
pageRectsize of the page
scaleIfTooLargescale image if it is too large for pageRect
scaleIfTooSmallscale image if it is smaller than pageRect

◆ gridPrintingCalc()

void JKQTBasePlotter::gridPrintingCalc ( )
protected

This method goes through all registered plotters and calculates the width of every column and height of every row as the max over the row/column. The reults are stored in the private datamembers gridPrintingRows and gridPrintingColumns. gridPrintingSize will contain the size of all graphs together afterwards.

◆ hasXAxis()

bool JKQTBasePlotter::hasXAxis ( JKQTPCoordinateAxisRef  axis = JKQTPPrimaryAxis) const

returns whether an x-axis axis is registered with the plotter

Note
For axis ==JKQTPPrimaryAxis this function returns always true

◆ hasYAxis()

bool JKQTBasePlotter::hasYAxis ( JKQTPCoordinateAxisRef  axis = JKQTPPrimaryAxis) const

returns whether a y-axis axis is registered with the plotter

Note
For axis ==JKQTPPrimaryAxis this function returns always true

◆ indexOfGraph()

int JKQTBasePlotter::indexOfGraph ( const JKQTPPlotElement gr) const

returns the index of the given graph gr in the graphs list, or -1 if it was not found

◆ initSettings()

void JKQTBasePlotter::initSettings ( )
protected

set the standard settings (colors, line widths ...)

◆ isDebugShowRegionBoxesEnabled()

bool JKQTBasePlotter::isDebugShowRegionBoxesEnabled ( ) const

if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the different regions in the plot (border, axes, ...)

See also
JKQTBasePlotterStyle::debugShowRegionBoxes, enableDebugShowRegionBoxes()

◆ isDebugShowTextBoxesEnabled()

bool JKQTBasePlotter::isDebugShowTextBoxesEnabled ( ) const

if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the extent of text

See also
JKQTBasePlotterStyle::debugShowTextBoxes, enableDebugShowTextBoxes()

◆ isEmittingPlotSignalsEnabled()

bool JKQTBasePlotter::isEmittingPlotSignalsEnabled ( ) const

returns, whether the signals plotUpdated() are emitted

◆ isEmittingSignalsEnabled()

bool JKQTBasePlotter::isEmittingSignalsEnabled ( ) const

returns whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate()

◆ isPlotFrameVisible()

bool JKQTBasePlotter::isPlotFrameVisible ( ) const

if true, JKQTBasePlotter will draw a rectangle/frame around the plot

◆ isUsingAntiAliasingForGraphs()

bool JKQTBasePlotter::isUsingAntiAliasingForGraphs ( ) const

specifies whether to use antialiasing for plotting the graphs

Note
You can set this property false to increase plotting speed of complex plots (with many graphs inside). You can reach a roughly three-fold speed improvement!

◆ isUsingAntiAliasingForSystem()

bool JKQTBasePlotter::isUsingAntiAliasingForSystem ( ) const

specifies whether to use antialiasing for plotting the coordinate system


◆ isUsingAntiAliasingForText()

bool JKQTBasePlotter::isUsingAntiAliasingForText ( ) const

specifies whether to use antialiasing when drawing any text

Note
You can set this property false to increase plotting speed of complex plots (with many graphs inside). You can reach a roughly three-fold speed improvement!

◆ loadCurrentPlotterStyle()

void JKQTBasePlotter::loadCurrentPlotterStyle ( const QSettings &  settings,
const QString &  group = "plots/" 
)

replace the current style properties for this JKQTBasePlotter with properties loaded from settings

Parameters
settingsthe QSettings object to read from
groupgroup in settings to read from
See also
JKQTPSetSystemDefaultBaseStyle(), JKQTPSetSystemDefaultBaseStyle(), getCurrentPlotterStyle(), Styling System

◆ loadSettings()

void JKQTBasePlotter::loadSettings ( const QSettings &  settings,
const QString &  group = QString("plots/") 
)

loads all the plot properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object

◆ loadUserSettings [1/2]

void JKQTBasePlotter::loadUserSettings ( )
slot

loads the plot user properties from the file sepcified by setUserSettigsFilename() and the prefix specified by setUserSettigsPrefix()

See also
saveUserSettings(), setUserSettigsPrefix(), getUserSettigsFilename(), getUserSettigsPrefix()

◆ loadUserSettings() [2/2]

void JKQTBasePlotter::loadUserSettings ( const QSettings &  settings,
const QString &  group = QString("plots_user/") 
)

loads the plot user properties from a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object

◆ mm2px() [1/3]

double JKQTBasePlotter::mm2px ( double  mm,
double  dpi 
) const
inline

returns the given size in millimeters to pixels (with given dots per inch)

◆ mm2px() [2/3]

double JKQTBasePlotter::mm2px ( double  mm,
JKQTPEnhancedPainter painter 
) const
inline

returns the given size in millimeters to pixels (with given dots per inch)

◆ mm2px() [3/3]

double JKQTBasePlotter::mm2px ( JKQTPEnhancedPainter painter,
double  mm 
) const
inline

returns the given size in millimeters to pixels (with given dots per inch)

◆ modifyGraphs()

void JKQTBasePlotter::modifyGraphs ( const std::function< void(JKQTPPlotElement *)> &  func)

apply functor func to all graphs in the plotter. After completing the operation, the graph is updated

◆ moveGraphBottom() [1/2]

void JKQTBasePlotter::moveGraphBottom ( const JKQTPPlotElement gr)

move the given graph gr to the bottom of all graphs

◆ moveGraphBottom() [2/2]

void JKQTBasePlotter::moveGraphBottom ( int  idx)

move the given graph to the top

◆ moveGraphDown() [1/2]

void JKQTBasePlotter::moveGraphDown ( const JKQTPPlotElement gr)

move the given graph gr one item down (i.e. it is drawn earlier/lower in the z-stack)

◆ moveGraphDown() [2/2]

void JKQTBasePlotter::moveGraphDown ( int  idx)

move the graph at position idx one item down (i.e. it is drawn earlier/lower in the z-stack)

◆ moveGraphTop() [1/2]

void JKQTBasePlotter::moveGraphTop ( const JKQTPPlotElement gr)

move the given graph gr to the end of all graphs, so it is drawn

◆ moveGraphTop() [2/2]

void JKQTBasePlotter::moveGraphTop ( int  idx)

move the given graph to the top

◆ moveGraphUp() [1/2]

void JKQTBasePlotter::moveGraphUp ( const JKQTPPlotElement gr)

move the given graph gr one item up (i.e. it is drawn later/higher in the z-stack)

◆ moveGraphUp() [2/2]

void JKQTBasePlotter::moveGraphUp ( int  idx)

move the graph at position idx one item up (i.e. it is drawn later/higher in the z-stack)

◆ p2x()

double JKQTBasePlotter::p2x ( double  x) const
inline

return x coordinate from x-pixel, using the primary axis

◆ p2y()

double JKQTBasePlotter::p2y ( double  y) const
inline

return y coordinate from y-pixel, using the primary axis

◆ plotScalingRecalculated

void JKQTBasePlotter::plotScalingRecalculated ( )
signal

emitted when the plot scaling had to be recalculated

◆ plotUpdated

void JKQTBasePlotter::plotUpdated ( )
signal

emitted when the plot has to be updated

◆ print

void JKQTBasePlotter::print ( QPrinter *  printer = nullptr,
bool  displayPreview = true 
)
slot

print the current plot, if printer is nullptr a printer selection dialog is displayed

Note
This function is only available on platforms with QPrinter support!

◆ printpreviewNew()

bool JKQTBasePlotter::printpreviewNew ( QPaintDevice *  paintDevice,
bool  setAbsolutePaperSize = false,
double  printsizeX_inMM = -1.0,
double  printsizeY_inMM = -1.0,
bool  displayPreview = true 
)
protected

show the print preview window for a given print p

◆ printpreviewPaintRequested

void JKQTBasePlotter::printpreviewPaintRequested ( QPrinter *  printer)
protectedslot

internal function for print preview

◆ printpreviewPaintRequestedNewPaintDevice

void JKQTBasePlotter::printpreviewPaintRequestedNewPaintDevice ( QPaintDevice *  paintDevice)
protectedslot

internal function for print preview

◆ printpreviewPaintRequestedNewPrinter

void JKQTBasePlotter::printpreviewPaintRequestedNewPrinter ( QPrinter *  printer)
protectedslot

internal function for print preview

◆ printpreviewSetAspectRatio

void JKQTBasePlotter::printpreviewSetAspectRatio ( bool  checked)
protectedslot

internal function for print preview

◆ printpreviewSetFontSizeMultiplier

void JKQTBasePlotter::printpreviewSetFontSizeMultiplier ( double  value)
protectedslot

internal function for print preview

◆ printpreviewSetKeepAbsFontsize

void JKQTBasePlotter::printpreviewSetKeepAbsFontsize ( bool  checked)
protectedslot

internal function for print preview

◆ printpreviewSetLineWidthMultiplier

void JKQTBasePlotter::printpreviewSetLineWidthMultiplier ( double  value)
protectedslot

internal function for print preview

◆ printpreviewSetMagnification

void JKQTBasePlotter::printpreviewSetMagnification ( double  value)
protectedslot

internal function for print preview

◆ printpreviewSetMagnificationNew

void JKQTBasePlotter::printpreviewSetMagnificationNew ( double  value)
protectedslot

internal function for print preview

◆ printpreviewSetSizeX

void JKQTBasePlotter::printpreviewSetSizeX ( double  value)
protectedslot

internal function for print preview

◆ printpreviewSetSizeXNew

void JKQTBasePlotter::printpreviewSetSizeXNew ( double  value)
protectedslot

internal function for print preview

◆ printpreviewSetSizeY

void JKQTBasePlotter::printpreviewSetSizeY ( double  value)
protectedslot

internal function for print preview

◆ printpreviewSetSizeYNew

void JKQTBasePlotter::printpreviewSetSizeYNew ( double  value)
protectedslot

internal function for print preview

◆ printpreviewSetZoom

void JKQTBasePlotter::printpreviewSetZoom ( double  value)
protectedslot

internal function for print preview

◆ printpreviewToggleMagnification

void JKQTBasePlotter::printpreviewToggleMagnification ( bool  checked)
protectedslot

internal function for print preview

◆ printpreviewUpdate

void JKQTBasePlotter::printpreviewUpdate ( )
protectedslot

internal function for print preview

◆ propagateStyle()

void JKQTBasePlotter::propagateStyle ( )
protected

copy sub-properties of plotterStyle to sub-objects that require it (axes, axes in graphs ...) and emit a plot update

◆ pt2px() [1/3]

double JKQTBasePlotter::pt2px ( double  pt,
double  dpi 
) const
inline

returns the given size in DTP points points (1/72inch = 0.353mm) to pixels (with given dots per inch)

◆ pt2px() [2/3]

double JKQTBasePlotter::pt2px ( double  pt,
JKQTPEnhancedPainter painter 
) const
inline

returns the given size in DTP points points (1/72inch = 0.353mm) to pixels (with given dots per inch)

◆ pt2px() [3/3]

double JKQTBasePlotter::pt2px ( JKQTPEnhancedPainter painter,
double  pt 
) const
inline

returns the given size in DTP points points (1/72inch = 0.353mm) to pixels (with given dots per inch)

◆ redrawPlot()

void JKQTBasePlotter::redrawPlot ( )
inline

emit plotUpdated(), which can be used by e.g. a widget class to update the displayed plot

◆ registerAdditionalAction()

void JKQTBasePlotter::registerAdditionalAction ( const QString &  key,
QAction *  act 
)

this function registers additional actions to lstAdditionalPlotterActions, which are displayed in the context-menu

◆ registerPaintDeviceAdapter()

static void JKQTBasePlotter::registerPaintDeviceAdapter ( JKQTPPaintDeviceAdapter adapter)
static

register a user-defined QPaintDevice (with factory JKQTPPaintDeviceAdapter) as a plugin to JKQTBasePlotter/JKQTPlotter, which will use it to export graphics

◆ registerSaveDataAdapter()

static bool JKQTBasePlotter::registerSaveDataAdapter ( JKQTPSaveDataAdapter adapter)
static

register a JKQTPSaveDataAdapter with JKQTPlotter/JKQTBasePlotter that can be used to export data from the internal datastore into a file

◆ resetMasterSynchronization()

void JKQTBasePlotter::resetMasterSynchronization ( SynchronizationDirection  synchronizeDirection = sdXYAxes)

switches any synchronization off, that has been created by synchronizeToMaster()

◆ saveAsCSV() [1/2]

void JKQTBasePlotter::saveAsCSV ( const QString &  filename,
const QString &  decimalSeparator,
const QString &  commentInitializer 
)

save the current plot data as a Comma Separated Values (CSV) file

Parameters
filenamethe file to save to, if filename is empty, a file open dialog will be shown
decimalSeparatordecimal separator for outpu
commentInitializerline-start for comment lines

example output:

# x, y
0, 0
0.251327, 0.24869
0.502655, 0.481754
...

This method uses JKQTBasePlotterStyle::CSVdecimalSeparator as decimal separator and JKQTBasePlotterStyle::CSVcommentInitializer as comment initializer!

◆ saveAsCSV [2/2]

void JKQTBasePlotter::saveAsCSV ( const QString &  filename = QString(""))
slot

save the current plot data as a Comma Separated Values (CSV) file

Parameters
filenamethe file to save to, if filename is empty, a file open dialog will be shown

This method uses JKQTBasePlotterStyle::CSVdecimalSeparator as decimal separator and JKQTBasePlotterStyle::CSVcommentInitializer as comment initializer!

◆ saveAsDIF

void JKQTBasePlotter::saveAsDIF ( const QString &  filename = QString(""))
slot

save the current plot data as a Data Interchange Format file (see https://en.wikipedia.org/wiki/Data_Interchange_Format).

Parameters
filenamethe file to save to, if filename is empty, a file open dialog will be shown
See also
saveData()

◆ saveAsGerExcelCSV

void JKQTBasePlotter::saveAsGerExcelCSV ( const QString &  filename = QString(""))
slot

save the current plot data as a Semicolon Separated Values (CSV) file for german Excel, i.e. with comma as decimal separator

Parameters
filenamethe file to save to, if filename is empty, a file open dialog will be shown

example output:

# x, y
0, 0
0,251327; 0,24869
0,502655; 0,481754
...
See also
saveData(), saveAsSemicolonSV()

◆ saveAsMatlab

void JKQTBasePlotter::saveAsMatlab ( const QString &  filename = QString(""))
slot

save the current plot data as a Matlab Script

Parameters
filenamethe file to save to, if filename is empty, a file open dialog will be shown

example output:

% data from columne 1 ('x')
x = [ 0 0.251327 0.502655 ... ];
% data from columne 2 ('y')
y = [ 0 0.24869 0.481754 ... ];
See also
copyDataMatlab(), saveData()

◆ saveAsPDF

bool JKQTBasePlotter::saveAsPDF ( const QString &  filename = QString(""),
bool  displayPreview = true 
)
slot

save the current plot as a PDF file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed

Parameters
filenamethe filename to save to, if empty a file save dialog is displayed
displayPreviewif true, a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings.
Returns
Returns true if the file was save successfully
Note
Exporting to PDF requires QPrinter-support, if it is not available on your platform, this function will not be available either!

◆ saveAsPixelImage

bool JKQTBasePlotter::saveAsPixelImage ( const QString &  filename = QString(""),
bool  displayPreview = true,
const QByteArray &  outputFormat = QByteArray(),
const QSize &  outputSizeIncrease = QSize(0, 0) 
)
slot

save the current plot as a pixel image image (PNG ...), if filename is empty a file selection dialog is displayed

Parameters
filenamename of the stored file, if no outputFormat is given, the file format is deduced by the file extension in filename
displayPreviewif true a dialog is shown that allows to modify the generated output (zoo, scaling, ...)
outputFormatspecify the file format for the generated file
outputSizeIncreaseif given, the size of the generated pixel image is increased by this number of pixels in addition to the required space
Returns
returns true on success

This function may generate any pixel-graphics format, supported by Qt and listed in QImageWriter::supportedImageFormats(). The parameters are comparable to the standard Qt functions like QImage::save(), which is also used internally.

See also
grabPixelImage(), copyPixelImage()

◆ saveAsSemicolonSV() [1/2]

void JKQTBasePlotter::saveAsSemicolonSV ( const QString &  filename,
const QString &  decimalSeparator,
const QString &  commentInitializer 
)

save the current plot data as a Semicolon Separated Values (SSV) file

Parameters
filenamethe file to save to, if filename is empty, a file open dialog will be shown
decimalSeparatordecimal separator for outpu
commentInitializerline-start for comment lines

example output for saveAsSemicolonSV(filename, ",","#"):

# x, y
0, 0
0,251327; 0,24869
0,502655; 0,481754
...

◆ saveAsSemicolonSV [2/2]

void JKQTBasePlotter::saveAsSemicolonSV ( const QString &  filename = QString(""))
slot

save the current plot data as a Semicolon Separated Values (SSV) file

Parameters
filenamethe file to save to, if filename is empty, a file open dialog will be shown

example output:

# x, y
0; 0
0.251327; 0.24869
0.502655; 0.481754
...

This method uses JKQTBasePlotterStyle::CSVdecimalSeparator as decimal separator and JKQTBasePlotterStyle::CSVcommentInitializer as comment initializer!

◆ saveAsSVG

bool JKQTBasePlotter::saveAsSVG ( const QString &  filename = QString(""),
bool  displayPreview = true 
)
slot

save the current plot as a SVG file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed

Parameters
filenamethe filename to save to, if empty a file save dialog is displayed
displayPreviewif true, a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings.
Returns
Returns true if the file was save successfully
Note
Exporting to SVG requires QPrinter-support, if it is not available on your platform, this function will not be available either!

◆ saveAsSYLK

void JKQTBasePlotter::saveAsSYLK ( const QString &  filename = QString(""))
slot

save the current plot data as a SYmbolik LinK (SYLK) spreadsheet file (see https://en.wikipedia.org/wiki/Symbolic_Link_(SYLK) )

Parameters
filenamethe file to save to, if filename is empty, a file open dialog will be shown
See also
saveData()

◆ saveAsTabSV() [1/2]

void JKQTBasePlotter::saveAsTabSV ( const QString &  filename,
const QString &  decimalSeparator,
const QString &  commentInitializer 
)

save the current plot data as a Tabulator Separated Values (CSV) file

Parameters
filenamethe file to save to, if filename is empty, a file open dialog will be shown
decimalSeparatordecimal separator for outpu
commentInitializerline-start for comment lines

example output for saveAsTabSV(filename, ",","#"):

# x y
0 0
0,251327 0,24869
0,502655 0,481754
...

◆ saveAsTabSV [2/2]

void JKQTBasePlotter::saveAsTabSV ( const QString &  filename = QString(""))
slot

save the current plot data as a Tabulator Separated Values (CSV) file

Parameters
filenamethe file to save to, if filename is empty, a file open dialog will be shown

example output:

# x y
0 0
0.251327 0.24869
0.502655 0.481754
...

This method uses JKQTBasePlotterStyle::CSVdecimalSeparator as decimal separator and JKQTBasePlotterStyle::CSVcommentInitializer as comment initializer!

See also
saveData()

◆ saveCurrentPlotterStyle()

void JKQTBasePlotter::saveCurrentPlotterStyle ( QSettings &  settings,
const QString &  group = "plots/" 
) const

store the current style properties for this JKQTBasePlotter with properties loaded from settings

Parameters
settingsthe QSettings object to write to
groupgroup in settings to write to
See also
JKQTPSetSystemDefaultBaseStyle(), JKQTPSetSystemDefaultBaseStyle(), getCurrentPlotterStyle(), Styling System

◆ saveData

bool JKQTBasePlotter::saveData ( const QString &  filename = QString(""),
const QString &  format = QString("") 
)
slot

save the data used for the current plot. The file format is extracted from the file extension (csv, ...)

Parameters
filenamethe filename to save to, if empty a file save dialog is displayed
formatThe parameter format specifies the export format. if it is empty the format will be choosen according to the file extension, or if filename is also empty the format will be choosen according to what is selected in the file selection dialog. See below for a listing of supported values.
Returns
returns true if the data was exported successfully.

These values are supported for format (if format is not provided, the function tries to guess it from the file extensions liste below):

In addition you can use the custom exporters implemented as JKQTPSaveDataAdapter and registered using JKQTBasePlotter::registerSaveDataAdapter(). For these you need to use format = "customN", where N is the index of the exporter in the list of registered exporters.

◆ saveImage

bool JKQTBasePlotter::saveImage ( const QString &  filename = QString(""),
bool  displayPreview = true 
)
slot

save the current plot as an image file, with the current widget aspect ratio, if filename is empty a file selection dialog is displayed. The image format is extracted from the file extension (jpeg, tiff, png, pdf, ...)

Parameters
filenamethe filename to save to, if empty a file save dialog is displayed
displayPreviewif true, a save/print-preview dialog is displayed that allows to make some modifications to the generated image, otherwise the image is saved with default settings.
Returns
Returns true if the file was save successfully

This function is comparable to saveAsPixelImage(), but it allows to save into any graphics format, including SVG and PF (if printer-support is compiled into the library). Also it may use the custom exporters implemented as JKQTPPaintDeviceAdapter and registered via JKQTBasePlotter::registerPaintDeviceAdapter().

See also
grabPixelImage(), copyPixelImage(), saveAsPixelImage(), JKQTBasePlotter::registerPaintDeviceAdapter(), JKQTPPaintDeviceAdapter

◆ saveSettings()

void JKQTBasePlotter::saveSettings ( QSettings &  settings,
const QString &  group = QString("plots/") 
) const

saves the plot properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object.

This method only saves those properties that differ from their default value.

◆ saveUserSettings [1/2]

void JKQTBasePlotter::saveUserSettings ( ) const
slot

saves the plot user properties to the file sepcified by setUserSettigsFilename() and the prefix specified by setUserSettigsPrefix()

See also
loadUserSettings(), setUserSettigsPrefix(), getUserSettigsFilename(), getUserSettigsPrefix()

◆ saveUserSettings() [2/2]

void JKQTBasePlotter::saveUserSettings ( QSettings &  settings,
const QString &  group = QString("plots_user/") 
) const

saves the plot user properties into a <a href="http://doc.qt.io/qt-5/qsettings.html")">QSettings object.

◆ setAbsoluteX

void JKQTBasePlotter::setAbsoluteX ( double  xminn,
double  xmaxx 
)
slot

sets absolutely limiting x-range of the plot

The user (or programmer) cannot zoom to a viewport that is larger than the range given to this function. This is implemented by calling JKQTPCoordinateAxis::setAbsoluteRange() for the major x-axes!

Parameters
xminnabsolute minimum of x-axis
xmaxxabsolute maximum of x-axis
Note
if the aspect ratio of this does not fit into the widget, it is possible that you don't see the complete contents!
See also
setAbsoluteXY(), setAbsoluteY(), JKQTPCoordinateAxis::setAbsoluteRange()

◆ setAbsoluteXY

void JKQTBasePlotter::setAbsoluteXY ( double  xminn,
double  xmaxx,
double  yminn,
double  ymaxx 
)
slot

sets absolutely limiting x- and y-range of the plot

The user (or programmer) cannot zoom to a viewport that is larger than the range given to this function. This is implemented by calling JKQTPCoordinateAxis::setAbsoluteRange() for the major axes!

Parameters
xminnabsolute minimum of x-axis
xmaxxabsolute maximum of x-axis
yminnabsolute minimum of y-axis
ymaxxabsolute maximum of y-axis
Note
if the aspect ratio of this does not fit into the widget, it is possible that you don't see the complete contents!
See also
setAbsoluteX(), setAbsoluteY(), JKQTPCoordinateAxis::setAbsoluteRange()

◆ setAbsoluteY

void JKQTBasePlotter::setAbsoluteY ( double  yminn,
double  ymaxx 
)
slot

sets absolute minimum and maximum y-value to plot

The user (or programmer) cannot zoom to a viewport that is larger than the range given to this function. This is implemented by calling JKQTPCoordinateAxis::setAbsoluteRange() for the major y-axes!

Parameters
yminnabsolute minimum of y-axis
ymaxxabsolute maximum of y-axis
Note
if the aspect ratio of this does not fit into the widget, it is possible that you don't see the complete contents!
See also
setAbsoluteXY(), setAbsoluteX(), JKQTPCoordinateAxis::setAbsoluteRange()

◆ setAllGraphsInvisible

void JKQTBasePlotter::setAllGraphsInvisible ( )
slot

set all graphs in the plotter invisible

See also
setAllGraphsVisible(), setGraphVisible(), JKQTPPlotElement::setVisible()

◆ setAllGraphsVisible

void JKQTBasePlotter::setAllGraphsVisible ( )
slot

set all graphs in the plotter visible

See also
setAllGraphsInvisible(), setGraphVisible(), JKQTPPlotElement::setVisible()

◆ setAspectRatio

void JKQTBasePlotter::setAspectRatio ( double  __value)
slot

sets the data aspect ratio, enforced with setMaintainApsectRatio(true)

See also
aspectRatio

◆ setAxisAspectRatio

void JKQTBasePlotter::setAxisAspectRatio ( double  __value)
slot

sets the axis aspect ratio, enforced with setMaintainAxisApsectRatio(true)

See also
axisAspectRatio

◆ setBackgroundBrush

void JKQTBasePlotter::setBackgroundBrush ( const QBrush &  __value)
slot

color of the background of the plot (widget area) when drawing (to the screen)

◆ setBackgroundColor

void JKQTBasePlotter::setBackgroundColor ( const QColor &  __value)
slot

color of the background of the plot (widget area) when drawing (to the screen)

◆ setBackgroundGradient

void JKQTBasePlotter::setBackgroundGradient ( const QGradient &  __value)
slot

color of the background of the plot (widget area) when drawing (to the screen)

◆ setBackgroundTexture [1/2]

void JKQTBasePlotter::setBackgroundTexture ( const QImage &  __value)
slot

color of the background of the plot (widget area) when drawing (to the screen)

◆ setBackgroundTexture [2/2]

void JKQTBasePlotter::setBackgroundTexture ( const QPixmap &  __value)
slot

color of the background of the plot (widget area) when drawing (to the screen)

◆ setCSVcommentInitializer

void JKQTBasePlotter::setCSVcommentInitializer ( const QString &  __value)
slot

set the string used to introduce comments in text output when exporting data

◆ setCSVdecimalSeparator

void JKQTBasePlotter::setCSVdecimalSeparator ( const QString &  __value)
slot

set the decimal separator used when exporting data to text files

◆ setCurrentFileFormat

void JKQTBasePlotter::setCurrentFileFormat ( const QString &  __value)
slot

set the file format to use in SaveAs ... dialogs

◆ setCurrentPlotterStyle()

void JKQTBasePlotter::setCurrentPlotterStyle ( const JKQTBasePlotterStyle style)

◆ setCurrentSaveDirectory

void JKQTBasePlotter::setCurrentSaveDirectory ( const QString &  __value)
slot

sets the current directory in which to open SaveAs ... dialogs

◆ setDefaultJKQTBasePrinterUserSettings()

static void JKQTBasePlotter::setDefaultJKQTBasePrinterUserSettings ( QString  userSettigsFilename,
const QString &  userSettigsPrefix 
)
static

set a global preset/default value for the userSettigsFilename and userSettigsPrefix properties of JKQTBasePlotter

These presets are application global and will be used ONLY on initialization of a JKQTBasePlotter. You can overwrite them on a local-basis for each JKQTBasePrinter separately. The changed values from this function call will only take effect for newly created plotters AFTER the function call!

◆ setDefaultTextColor

void JKQTBasePlotter::setDefaultTextColor ( QColor  __value)
slot

default text color in the plot

◆ setDefaultTextFontName

void JKQTBasePlotter::setDefaultTextFontName ( const QString &  __value)
slot

default font name in the plot

◆ setDefaultTextSize

void JKQTBasePlotter::setDefaultTextSize ( double  __value)
slot

default font size in the plot [pt]

◆ setEmittingPlotSignalsEnabled()

void JKQTBasePlotter::setEmittingPlotSignalsEnabled ( bool  __value)

controls, whether the signals plotUpdated() are emitted

◆ setEmittingSignalsEnabled()

void JKQTBasePlotter::setEmittingSignalsEnabled ( bool  enabled)

specifies whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate()

◆ setExportBackgroundBrush

void JKQTBasePlotter::setExportBackgroundBrush ( const QBrush &  __value)
slot

color of the background of the plot (widget area) when exporting

◆ setExportBackgroundColor

void JKQTBasePlotter::setExportBackgroundColor ( const QColor &  __value)
slot

color of the background of the plot (widget area) when exporting

◆ setExportBackgroundGradient

void JKQTBasePlotter::setExportBackgroundGradient ( const QGradient &  __value)
slot

color of the background of the plot (widget area) when exporting

◆ setExportBackgroundTexture [1/2]

void JKQTBasePlotter::setExportBackgroundTexture ( const QImage &  __value)
slot

color of the background of the plot (widget area) when exporting

◆ setExportBackgroundTexture [2/2]

void JKQTBasePlotter::setExportBackgroundTexture ( const QPixmap &  __value)
slot

color of the background of the plot (widget area) when exporting

◆ setFontSizeMultiplier()

void JKQTBasePlotter::setFontSizeMultiplier ( double  __value)
protected

multiplier for the font size

◆ setFontSizePrintMultiplier()

void JKQTBasePlotter::setFontSizePrintMultiplier ( double  __value)

multiplier which is used for font sizes when the plot is exported/printed

◆ setGraphInvisible

void JKQTBasePlotter::setGraphInvisible ( int  i)
slot

switch visibility of the i -th graph to visible

See also
setAllGraphsInvisible(), setAllGraphsVisible(), JKQTPPlotElement::setVisible()

◆ setGraphVisible

void JKQTBasePlotter::setGraphVisible ( int  i,
bool  visible = true 
)
slot

switch visibility of the i -th graph to visible

See also
setAllGraphsInvisible(), setAllGraphsVisible(), JKQTPPlotElement::setVisible()

◆ setGrid

void JKQTBasePlotter::setGrid ( bool  val)
slot

sets whether the major grid lines of the major axes are shown

Grid visible
Grid invisible
See also
JKQTPCoordinateAxis::setDrawGrid() and JKQTPGridStyle::enabled in JKQTPCoordinateAxisStyle::majorGridStyle

◆ setGridColor

void JKQTBasePlotter::setGridColor ( QColor  color)
slot

sets the color of all major grid lines (of the major x- and y-axis)

See also
JKQTPCoordinateAxis::setGridColor() and JKQTPGridStyle::lineColor in JKQTPCoordinateAxisStyle::majorGridStyle

◆ setGridPrinting()

void JKQTBasePlotter::setGridPrinting ( bool  __value)

indicates whether the grid printing is activated

See also
Grid Printing/Declaring Relations between Plots

◆ setGridPrintingCurrentPos()

void JKQTBasePlotter::setGridPrintingCurrentPos ( size_t  x,
size_t  y 
)

◆ setGridPrintingCurrentX()

void JKQTBasePlotter::setGridPrintingCurrentX ( size_t  __value)

x position of the current graph in grid printing

See also
Grid Printing/Declaring Relations between Plots

◆ setGridPrintingCurrentY()

void JKQTBasePlotter::setGridPrintingCurrentY ( size_t  __value)

y position of the current graph in grid printing

See also
Grid Printing/Declaring Relations between Plots

◆ setGridStyle

void JKQTBasePlotter::setGridStyle ( Qt::PenStyle  __value)
slot

◆ setGridWidth

void JKQTBasePlotter::setGridWidth ( double  __value)
slot

◆ setKeyPosition

void JKQTBasePlotter::setKeyPosition ( const JKQTPKeyPosition __value)
slot

key position inside or besides the plot area, see JKQTPKeyPositions for details and examples

◆ setLineWidthMultiplier()

void JKQTBasePlotter::setLineWidthMultiplier ( double  __value)
protected

multiplier or the line widths

◆ setLineWidthPrintMultiplier()

void JKQTBasePlotter::setLineWidthPrintMultiplier ( double  __value)

multiplier which is used for linewidths when the plot is exported/printed

◆ setMaintainAspectRatio

void JKQTBasePlotter::setMaintainAspectRatio ( bool  value)
slot

en-/disables the maintaining of the data aspect ratio

See also
aspectRatio

◆ setMaintainAxisAspectRatio

void JKQTBasePlotter::setMaintainAxisAspectRatio ( bool  value)
slot

en-/disables the maintaining of the axis aspect ratio

See also
axisAspectRatio

◆ setMinorGridColor

void JKQTBasePlotter::setMinorGridColor ( QColor  color)
slot

sets the color of all minor grid lines (of the major x- and y-axis)

See also
JKQTPCoordinateAxis::setMinorGridColor() and JKQTPGridStyle::lineColor in JKQTPCoordinateAxisStyle::minorGridStyle

◆ setMinorGridStyle

void JKQTBasePlotter::setMinorGridStyle ( Qt::PenStyle  __value)
slot

◆ setMinorGridWidth

void JKQTBasePlotter::setMinorGridWidth ( double  __value)
slot

◆ setOnlyGraphVisible

void JKQTBasePlotter::setOnlyGraphVisible ( int  i)
slot

set all graphs invisible, except i

◆ setOnlyNthGraphsVisible

void JKQTBasePlotter::setOnlyNthGraphsVisible ( int  start,
int  n 
)
slot

set all graphs invisible, except graph start, start+n, start+2*n, ...

◆ setPaintMagnification()

void JKQTBasePlotter::setPaintMagnification ( double  __value)
protected

this is an internal property that is used by the export/print system to control the "magnification". Usually this is 1.0 but if set !=1.0, it is used to scale the widgetWidth and widgetHeight before painting!

◆ setPlotBackgroundBrush

void JKQTBasePlotter::setPlotBackgroundBrush ( const QBrush &  __value)
slot

color of the plot's background (i.e. of the area within the coordinate axes rectangle)

◆ setPlotBackgroundColor

void JKQTBasePlotter::setPlotBackgroundColor ( const QColor &  __value)
slot

color of the plot's background (i.e. of the area within the coordinate axes rectangle)

◆ setPlotBackgroundGradient

void JKQTBasePlotter::setPlotBackgroundGradient ( const QGradient &  __value)
slot

color of the plot's background (i.e. of the area within the coordinate axes rectangle)

◆ setPlotBackgroundTexture [1/2]

void JKQTBasePlotter::setPlotBackgroundTexture ( const QImage &  __value)
slot

color of the plot's background (i.e. of the area within the coordinate axes rectangle)

◆ setPlotBackgroundTexture [2/2]

void JKQTBasePlotter::setPlotBackgroundTexture ( const QPixmap &  __value)
slot

color of the plot's background (i.e. of the area within the coordinate axes rectangle)

◆ setPlotBorder

void JKQTBasePlotter::setPlotBorder ( int  left,
int  right,
int  top,
int  bottom 
)
slot

sets the borders of the plot

See also
Plot Sizes & Borders

◆ setPlotBorderBottom

void JKQTBasePlotter::setPlotBorderBottom ( int  bottom)
slot

sets the bottom border of the plot

See also
Plot Sizes & Borders

◆ setPlotBorderLeft

void JKQTBasePlotter::setPlotBorderLeft ( int  left)
slot

sets the left border of the plot

See also
Plot Sizes & Borders

◆ setPlotBorderRight

void JKQTBasePlotter::setPlotBorderRight ( int  right)
slot

sets the right border of the plot

See also
Plot Sizes & Borders

◆ setPlotBorderTop

void JKQTBasePlotter::setPlotBorderTop ( int  top)
slot

sets the top border of the plot

See also
Plot Sizes & Borders

◆ setPlotFrameColor

void JKQTBasePlotter::setPlotFrameColor ( QColor  col)
slot

if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this color

◆ setPlotFrameRounding

void JKQTBasePlotter::setPlotFrameRounding ( double  __value)
slot

if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot, rounding the corners with this redius (<=0 -> no rounded rectangle) [pt]

◆ setPlotFrameVisible

void JKQTBasePlotter::setPlotFrameVisible ( bool  enabled)
slot

if true, JKQTBasePlotter will draw a rectangle/frame around the plot

◆ setPlotFrameWidth

void JKQTBasePlotter::setPlotFrameWidth ( double  __value)
slot

if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this width [pt]

◆ setPlotLabel

void JKQTBasePlotter::setPlotLabel ( const QString &  __value)
slot

set the plot label text

◆ setPlotLabelColor

void JKQTBasePlotter::setPlotLabelColor ( QColor  __value)
slot

the plot label color

◆ setplotLabelFontName

void JKQTBasePlotter::setplotLabelFontName ( const QString &  __value)
slot

the plot label font name

◆ setPlotLabelFontSize

void JKQTBasePlotter::setPlotLabelFontSize ( double  __value)
slot

the plot label font size [pt]

◆ setPlotLabelOffset

void JKQTBasePlotter::setPlotLabelOffset ( double  __value)
slot

offset of the plot label from the next element of the graph, i.e. below the label [pt].

See also
plotLabelTopBorder for spacing above

◆ setPlotLabelTopBorder

void JKQTBasePlotter::setPlotLabelTopBorder ( double  __value)
slot

offset of the plot label from the top [pt].

See also
plotLabelOffset for spacing between label and graph

◆ setPrintMagnification()

void JKQTBasePlotter::setPrintMagnification ( double  __value)
protected

◆ setShowKey

void JKQTBasePlotter::setShowKey ( bool  __value)
slot

indicates whether to plot a key

◆ setShowZeroAxes [1/2]

void JKQTBasePlotter::setShowZeroAxes ( bool  showX,
bool  showY 
)
slot

switches the visibility of the zero-axes associated with the major x- and y-axis

Parameters
showXindicates whether to show the zero-axis associated with the x-axis (i.e. x==0 or the vertical zero-axis)
showYindicates whether to show the zero-axis associated with the y-axis (i.e. y==0 or the horizontal zero-axis)
See also
JKQTPCoordinateAxis::showZeroAxis() and JKQTPCoordinateAxisStyle::showZeroAxis

◆ setShowZeroAxes [2/2]

void JKQTBasePlotter::setShowZeroAxes ( bool  showXY)
slot

switches the visibility of the zero-axes associated with the major x- and y-axis

Parameters
showXYindicates whether to show the zero-axis associated with the x-
y-axis
See also
JKQTPCoordinateAxis::showZeroAxis() and JKQTPCoordinateAxisStyle::showZeroAxis

◆ setUseAntiAliasingForGraphs

void JKQTBasePlotter::setUseAntiAliasingForGraphs ( bool  __value)
slot

specifies whether to use antialiasing for plotting the graphs

Note
You can set this property false to increase plotting speed of complex plots (with many graphs inside). You can reach a roughly three-fold speed improvement!

◆ setUseAntiAliasingForSystem

void JKQTBasePlotter::setUseAntiAliasingForSystem ( bool  __value)
slot

specifies whether to use antialiasing for plotting the coordinate system

◆ setUseAntiAliasingForText

void JKQTBasePlotter::setUseAntiAliasingForText ( bool  __value)
slot

specifies whether to use antialiasing when drawing any text

Note
You can set this property false to increase plotting speed of complex plots (with many graphs inside). You can reach a roughly three-fold speed improvement!

◆ setUserSettigsFilename [1/2]

void JKQTBasePlotter::setUserSettigsFilename ( const QString &  filename)
slot

◆ setUserSettigsFilename [2/2]

void JKQTBasePlotter::setUserSettigsFilename ( const QString &  filename,
const QString &  prefix 
)
slot

◆ setUserSettigsPrefix

void JKQTBasePlotter::setUserSettigsPrefix ( const QString &  prefix)
slot

◆ setWidgetHeight

void JKQTBasePlotter::setWidgetHeight ( int  heigh)
slot

sets the width of the plot widget

See also
setWidgetSize(), Plot Sizes & Borders

◆ setWidgetSize [1/2]

void JKQTBasePlotter::setWidgetSize ( int  width,
int  height 
)
slot

resize the plot

See also
Plot Sizes & Borders

◆ setWidgetSize [2/2]

void JKQTBasePlotter::setWidgetSize ( QSize  size)
slot

resize the plot

See also
Plot Sizes & Borders

◆ setWidgetWidth

void JKQTBasePlotter::setWidgetWidth ( int  wid)
slot

sets the width of the plot widget

See also
setWidgetSize(), Plot Sizes & Borders

◆ setX

void JKQTBasePlotter::setX ( double  xminn,
double  xmaxx,
bool  affectsSecondaryAxes = false 
)
slot

sets the x-range of the plot (minimum and maximum x-value on the x-axis)

Parameters
xminnabsolute minimum of x-axis
xmaxxabsolute maximum of x-axis
affectsSecondaryAxesif true, the secondary axes are affectedtoo, by using a relative zooming scheme, i.e. if a major axis range shrinks by 50%, also the secondary ranges shrink by 50% [default: false]
Note
You cannot expand the x-range outside the absolute x-range set e.g. by setAbsoluteX()! Also the range will be limited to possible values (e.g. to positive values if you use logarithmic axes).

Uppon setting, this function emits the signal zoomChangedLocally(), if emitting signals is activated at the moment (e.g. using setEmittingSignalsEnabled() ).

See also
setY(), setXY(), zoomToFit(), setAbsoluteXY(), JKQTPlotter::setY()

◆ setXY

void JKQTBasePlotter::setXY ( double  xminn,
double  xmaxx,
double  yminn,
double  ymaxx,
bool  affectsSecondaryAxes = false 
)
slot

sets the x- and y-range of the plot (minimum and maximum values on the x-/y-axis)

Parameters
xminnabsolute minimum of x-axis
xmaxxabsolute maximum of x-axis
yminnabsolute minimum of y-axis
ymaxxabsolute maximum of y-axis
affectsSecondaryAxesif true, the secondary axes are affectedtoo, by using a relative zooming scheme, i.e. if a major axis range shrinks by 50%, also the secondary ranges shrink by 50% [default: false]
Note
You cannot expand the ranges outside the absolute ranges set e.g. by setAbsoluteXY()! Also the range will be limited to possible values (e.g. to positive values if you use logarithmic axes).

Uppon setting, this function emits the signal zoomChangedLocally(), if emitting signals is activated at the moment (e.g. using setEmittingSignalsEnabled() ).

See also
setX(), setX(), zoomToFit(), setAbsoluteXY()

◆ setY

void JKQTBasePlotter::setY ( double  yminn,
double  ymaxx,
bool  affectsSecondaryAxes = false 
)
slot

sets the y-range of the plot (minimum and maximum y-value on the y-axis)

Parameters
yminnabsolute minimum of y-axis
ymaxxabsolute maximum of y-axis
affectsSecondaryAxesif true, the secondary axes are affectedtoo, by using a relative zooming scheme, i.e. if a major axis range shrinks by 50%, also the secondary ranges shrink by 50% [default: false]
Note
You cannot expand the y-range outside the absolute y-range set e.g. by setAbsoluteY()! Also the range will be limited to possible values (e.g. to positive values if you use logarithmic axes).

Uppon setting, this function emits the signal zoomChangedLocally(), if emitting signals is activated at the moment (e.g. using setEmittingSignalsEnabled() ).

See also
setX(), setXY(), zoomToFit(), setAbsoluteXY(), JKQTPlotter::setX()

◆ showPlotData

void JKQTBasePlotter::showPlotData ( )
protectedslot

internal function for getDataColumnsByUser()

◆ sortGraphs()

void JKQTBasePlotter::sortGraphs ( const std::function< bool(const JKQTPPlotElement *, const JKQTPPlotElement *)> &  compareLess)

sort the graphs, using functor compareLess to find whether a first graph shall be before (i.e. less) than a second graph. After completing the operation, the graph is updated

◆ synchronizeToMaster()

void JKQTBasePlotter::synchronizeToMaster ( JKQTBasePlotter master,
SynchronizationDirection  synchronizeDirection,
bool  synchronizeAxisLength = true,
bool  synchronizeZoomingMasterToSlave = true,
bool  synchronizeZoomingSlaveToMaster = true 
)

synchronize the plot borders (and zooming) with a given plotter (master --> slave/this)

This function allows two plotters to draw a graph with exactly the same height or width as in another graph. For example if you want to have two plotters which are positioned one above the other (and have the same widget widths, which could be guaranteed by a QLayout) you may want to make sure that their plotWidth s are always the same. In this case call

plotter2->synchronizeToMaster(plotter1, sdXAxis, true)

of the lower plotter plotter2 . Now whenever the size of plotter1 changes, also plotter2 is redrawn with the changed borders.

Parameters
masterthe plotter widget to synchronize to
synchronizeDirectiondirection in which to synchronize
synchronizeAxisLengthdo you want the axis length to be synchronized?
synchronizeZoomingMasterToSlaveif set, also zooming in the master leads to a modification of the linked axes in the slave
synchronizeZoomingSlaveToMasterif set, also zooming in the slave leads to a modification of the linked axes in the master
See also
synchronizeXToMaster(), synchronizeYToMaster(), Synchronizing Several Plots

◆ synchronizeXAxis

void JKQTBasePlotter::synchronizeXAxis ( double  newxmin,
double  newxmax,
double  newymin,
double  newymax,
JKQTBasePlotter sender 
)
protectedslot

may be connected to zoomChangedLocally() of a different plot and synchronizes the local x-axis to the other x-axis

◆ synchronizeXToMaster()

void JKQTBasePlotter::synchronizeXToMaster ( JKQTBasePlotter master,
bool  synchronizeAxisLength = true,
bool  synchronizeZoomingMasterToSlave = true,
bool  synchronizeZoomingSlaveToMaster = true 
)

synchronize the plot x-axis width (and x-zooming) with a given master plotter (master --> slave/this)

Parameters
masterthe plotter widget to synchronize to
synchronizeAxisLengthdo you want the axis length to be synchronized?
synchronizeZoomingMasterToSlaveif set, also zooming in the master leads to a modification of the linked axes in the slave
synchronizeZoomingSlaveToMasterif set, also zooming in the slave leads to a modification of the linked axes in the master
Note
This is a short-cut to synchronizeToMaster() with synchronizeDirection=csXAxis
See also
synchronizeToMaster(), synchronizeYToMaster(), Synchronizing Several Plots

◆ synchronizeXYAxis

void JKQTBasePlotter::synchronizeXYAxis ( double  newxmin,
double  newxmax,
double  newymin,
double  newymax,
JKQTBasePlotter sender 
)
protectedslot

may be connected to zoomChangedLocally() of a different plot and synchronizes the local x- and y-axis to the other x- and y-axis

◆ synchronizeYAxis

void JKQTBasePlotter::synchronizeYAxis ( double  newxmin,
double  newxmax,
double  newymin,
double  newymax,
JKQTBasePlotter sender 
)
protectedslot

may be connected to zoomChangedLocally() of a different plot and synchronizes the local y-axis to the other y-axis

◆ synchronizeYToMaster()

void JKQTBasePlotter::synchronizeYToMaster ( JKQTBasePlotter master,
bool  synchronizeAxisLength = true,
bool  synchronizeZoomingMasterToSlave = true,
bool  synchronizeZoomingSlaveToMaster = true 
)

synchronize the plot y-axis height (and y-zooming) with a given master plotter (master --> slave/this)

Parameters
masterthe plotter widget to synchronize to
synchronizeAxisLengthdo you want the axis length to be synchronized?
synchronizeZoomingMasterToSlaveif set, also zooming in the master leads to a modification of the linked axes in the slave
synchronizeZoomingSlaveToMasterif set, also zooming in the slave leads to a modification of the linked axes in the master
Note
This is a short-cut to synchronizeToMaster() with synchronizeDirection=csXAxis
See also
synchronizeToMaster(), synchronizeXToMaster(), Synchronizing Several Plots

◆ updatePreviewLabel

void JKQTBasePlotter::updatePreviewLabel ( )
protectedslot

internal function for print/export preview

◆ updateSecondaryAxes()

void JKQTBasePlotter::updateSecondaryAxes ( )

updates the secondary axes

The plot may contain (in addition to its primary axes) also secondary axes, that depend in their scaling (min,max, ...) on the primmary axes of the plot. This function updates/recalculates the scaling of these axes.

◆ useAsInternalDatastore()

void JKQTBasePlotter::useAsInternalDatastore ( JKQTPDatastore newStore)

tells the plotter object to use the given external datastore and treat it as an internal one (i.e. free it when the plotter object ist destroyed.

◆ useExternalDatastore()

void JKQTBasePlotter::useExternalDatastore ( JKQTPDatastore newStore)

tells the plotter object to use the given external datastore.

If the current datastore is internally managed, this method will free that object and use the supplied datastore with external management. If the current datastore is already external, this method will simply replace it by the new one.

◆ useInternalDatastore()

void JKQTBasePlotter::useInternalDatastore ( )

tells the plotter object to use an internal datastore. A new internal datastore object is generated only if the current datastore is not internal.

◆ x2p()

double JKQTBasePlotter::x2p ( double  x) const
inline

return x-pixel coordinate from x coordinate, using the primary axis

◆ y2p()

double JKQTBasePlotter::y2p ( double  y) const
inline

return y-pixel coordinate from y coordinate, using the primary axis

◆ zoom

void JKQTBasePlotter::zoom ( double  xminn,
double  xmaxx,
double  yminn,
double  ymaxx,
bool  affectsSecondaryAxes = false 
)
inlineslot

sets the x- and y-range of the plot (minimum and maximum values on the x-/y-axis)

Parameters
xminnabsolute minimum of x-axis
xmaxxabsolute maximum of x-axis
yminnabsolute minimum of y-axis
ymaxxabsolute maximum of y-axis
affectsSecondaryAxesif true, the secondary axes are affectedtoo, by using a relative zooming scheme, i.e. if a major axis range shrinks by 50%, also the secondary ranges shrink by 50% [default: false]
Note
You cannot expand the ranges outside the absolute ranges set e.g. by setAbsoluteXY()! Also the range will be limited to possible values (e.g. to positive values if you use logarithmic axes).

Uppon setting, this function emits the signal zoomChangedLocally(), if emitting signals is activated at the moment (e.g. using setEmittingSignalsEnabled() ).

See also
setX(), setX(), zoomToFit(), setAbsoluteXY()
Deprecated:
The function JKQTBasePlotter::zoom() is deprecated and will be removed in future version, use JKQTBasePlotter::setXY() instead!

◆ zoomChangedLocally

void JKQTBasePlotter::zoomChangedLocally ( double  newxmin,
double  newxmax,
double  newymin,
double  newymax,
JKQTBasePlotter sender 
)
signal

signal: emitted whenever the user selects a new x-y zoom range (in the major axes, e.g. setX(), setY(), setXY(), zoomToFit()... )

Parameters
newxminstart of the selected x-range (in plot coordinates)
newxmaxend of the selected x-range (in plot coordinates)
newyminstart of the selected x-range (in plot coordinates)
newymaxend of the selected x-range (in plot coordinates)
senderJKQTPlotter sending this event

◆ zoomIn

void JKQTBasePlotter::zoomIn ( double  factor = 2.0)
slot

zooms into the graph (the same as turning the mouse wheel) by the given factor

◆ zoomOut

void JKQTBasePlotter::zoomOut ( double  factor = 2.0)
slot

zooms out of the graph (the same as turning the mouse wheel) by the given factor

◆ zoomToFit

void JKQTBasePlotter::zoomToFit ( bool  zoomX = true,
bool  zoomY = true,
bool  includeX0 = false,
bool  includeY0 = false,
double  scaleX = 1.05,
double  scaleY = 1.05 
)
slot

this method zooms the graph so that all plotted datapoints are visible.

Parameters
zoomXif set true (default) zooms the x axis
zoomYif set true (default) zooms the y axis
includeX0if this is true zoomToFit() will ensure that $ x=0 $ is visible in the plot (only for non-logx plots, default: false)
includeY0if this is true zoomToFit() will ensure that $ y=0 $ is visible in the plot (only for non-logy plots, default: false)
scaleXthe plot will have a width of $ \mbox{Xscale}\cdot\Delta x $ where $ \Delta x $ is the actual x-axis data range For logx plots we actually use this on the logarithmized data! (default: 1.05)
scaleYthe plot will have a height of $ \mbox{Yscale}\cdot\Delta < $ where $ \Delta < $ is the actual <-axis data range For log< plots we actually use this on the logarithmized data! (default: 1.05)

Friends And Related Symbol Documentation

◆ JKQTPBaseKey

friend class JKQTPBaseKey
friend

◆ JKQTPMainKey

friend class JKQTPMainKey
friend

Member Data Documentation

◆ actCopyData

QAction* JKQTBasePlotter::actCopyData
protected

QAction which triggers copying of the data to the clipboard.

◆ actCopyMatlab

QAction* JKQTBasePlotter::actCopyMatlab
protected

QAction which triggers copying of the data to the clipboard in Matlab format.

◆ actCopyPixelImage

QAction* JKQTBasePlotter::actCopyPixelImage
protected

QAction which triggers copying of the image to the clipboard.

◆ actPrint

QAction* JKQTBasePlotter::actPrint
protected

QAction which triggers the printing.

◆ actSaveCSV

QAction* JKQTBasePlotter::actSaveCSV
protected

QAction which triggers the saving as CSV (data only)

◆ actSaveData

QAction* JKQTBasePlotter::actSaveData
protected

QAction which triggers saving of the data used for the plot.

◆ actSavePDF

QAction* JKQTBasePlotter::actSavePDF
protected

QAction which triggers the saving as PDF.

◆ actSavePix

QAction* JKQTBasePlotter::actSavePix
protected

QAction which triggers the saving as pixel image.

◆ actSavePlot

QAction* JKQTBasePlotter::actSavePlot
protected

QAction which triggers saving of the plot as an image.

◆ actSaveSVG

QAction* JKQTBasePlotter::actSaveSVG
protected

QAction which triggers the saving as Scalable Vector Graphics (SVG)

◆ actShowPlotData

QAction* JKQTBasePlotter::actShowPlotData
protected

QAction to show a table with all the plot data in the datastore.

◆ actZoomAll

QAction* JKQTBasePlotter::actZoomAll
protected

QAction which triggers zoom all.

◆ actZoomIn

QAction* JKQTBasePlotter::actZoomIn
protected

QAction which triggers zoom in.

◆ actZoomOut

QAction* JKQTBasePlotter::actZoomOut
protected

QAction which triggers zoom out.

◆ aspectRatio

double JKQTBasePlotter::aspectRatio
protected

the aspect ratio of plotwidth and plotheight to maintain, if maintainAspectRatio==true

\[ \mbox{aspectRatio}=\frac{\mbox{plotWidth}}{\mbox{plotHeight}} \]

See also
maintainAspectRatio

◆ axisAspectRatio

double JKQTBasePlotter::axisAspectRatio
protected

the aspect ratio of axis widths to maintain, if maintainAxisAspectRatio==true

When the axis aspect ratio is to be maintained and new axis ranges are set (e.g. when calling setXY() ), the given axis ranges are modified, so

\[ \mbox{axisAspectRatio}=\frac{\left|x_\text{max}-x_\text{min}\right|}{\left|y_\text{max}-y_\text{min}\right|} \]

Note
An axis aspect ratio is only well defined for linear axes (if both axes are linear). If both axes a logarithmic, the axis ration is defined for log(axismax)-log(axismin). For other combinations of axes, this function is deactivated
See also
maintainAxisAspectRatio

◆ currentDataFileFormat

QString JKQTBasePlotter::currentDataFileFormat
protected

the current file format to use in SaveDataAs ... dialogs

◆ currentFileFormat

QString JKQTBasePlotter::currentFileFormat
protected

the current file format to use in SaveAs ... dialogs

◆ currentPrinter

QString JKQTBasePlotter::currentPrinter
protected

the currently selected printer

◆ currentSaveDirectory

QString JKQTBasePlotter::currentSaveDirectory
protected

the current directory in which to open SaveAs ... dialogs

◆ dataColumnsCombobox

QComboBox* JKQTBasePlotter::dataColumnsCombobox
protected

◆ dataColumnsListWidget

QListWidget* JKQTBasePlotter::dataColumnsListWidget
protected

◆ datastore

JKQTPDatastore* JKQTBasePlotter::datastore
protected

an object which manages all data columns for this plotter class

◆ datastoreInternal

bool JKQTBasePlotter::datastoreInternal
protected

indicates whether the datastore is managed (allocated/freed) internally or externally

◆ emitPlotSignals

bool JKQTBasePlotter::emitPlotSignals
protected

controls, whether the signals plotUpdated() are emitted

◆ emitSignals

bool JKQTBasePlotter::emitSignals
protected

specifies whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate()

◆ exportPreviewLabel

QPointer<QLabel> JKQTBasePlotter::exportPreviewLabel
private

◆ exportUnitInMM

bool JKQTBasePlotter::exportUnitInMM
private

◆ fontSizeMultiplier

double JKQTBasePlotter::fontSizeMultiplier
protected

multiplier for the font size

◆ fontSizePrintMultiplier

double JKQTBasePlotter::fontSizePrintMultiplier
protected

multiplier which is used for font sizes when the plot is exported/printed

◆ getDataColumnsByUserSaved

QMap<QString, QStringList> JKQTBasePlotter::getDataColumnsByUserSaved
protected

◆ globalUserSettigsFilename

QString JKQTBasePlotter::globalUserSettigsFilename
staticprotected

◆ globalUserSettigsPrefix

QString JKQTBasePlotter::globalUserSettigsPrefix
staticprotected

◆ globalUserSettingsMutex

std::mutex JKQTBasePlotter::globalUserSettingsMutex
staticprotected

◆ graphs

GraphsList JKQTBasePlotter::graphs
protected

a vector that contains all graphs to be plottet in the system

◆ gridPrinting

bool JKQTBasePlotter::gridPrinting
protected

indicates whether the grid printing is activated

See also
Grid Printing/Declaring Relations between Plots

◆ gridPrintingColumns

QList<size_t> JKQTBasePlotter::gridPrintingColumns
protected

this list contains all the columns of the current grid printing and stores its widths

◆ gridPrintingCurrentX

size_t JKQTBasePlotter::gridPrintingCurrentX
protected

x position of the current graph in grid printing

See also
Grid Printing/Declaring Relations between Plots

◆ gridPrintingCurrentY

size_t JKQTBasePlotter::gridPrintingCurrentY
protected

y position of the current graph in grid printing

See also
Grid Printing/Declaring Relations between Plots

◆ gridPrintingList

QList<JKQTPGridPrintingItem> JKQTBasePlotter::gridPrintingList
protected

list that manages all the additional graphs for grid printing mode

◆ gridPrintingRows

QList<size_t> JKQTBasePlotter::gridPrintingRows
protected

this list contains all the rows of the current grid printing and stores its heights

◆ gridPrintingSize

QSizeF JKQTBasePlotter::gridPrintingSize
protected

size of all plots in grid printing mode, filled by gridPrintingCalc()

◆ internalPlotBorderBottom

double JKQTBasePlotter::internalPlotBorderBottom
protected

calculated value: free space between widget top border and plot top border, as used to plot the graph

Note
This property is an intermediate storage for calculated values. Do not change directly!

◆ internalPlotBorderLeft

double JKQTBasePlotter::internalPlotBorderLeft
protected

calculated value: free space between widget top border and plot top border, as used to plot the graph

Note
This property is an intermediate storage for calculated values. Do not change directly!

◆ internalPlotBorderRight

double JKQTBasePlotter::internalPlotBorderRight
protected

calculated value: free space between widget top border and plot top border, as used to plot the graph

Note
This property is an intermediate storage for calculated values. Do not change directly!

◆ internalPlotBorderTop

double JKQTBasePlotter::internalPlotBorderTop
protected

calculated value: free space between widget top border and plot top border, as used to plot the graph

Note
This property is an intermediate storage for calculated values. Do not change directly!

◆ internalPlotHeight

int JKQTBasePlotter::internalPlotHeight
protected

calculated value: plot height in pixel inside the widget (calculated by calcPlotScaling() from plotBorderTop, plotBorderBottom and widgetHeight)

See also
Plot Sizes & Borders

◆ internalPlotKeyDescription

JKQTPBaseKey::KeySizeDescription JKQTBasePlotter::internalPlotKeyDescription
protected

calculated value: size and location of the plot key

Note
This property is an intermediate storage for calculated values. Do not change directly!

◆ internalPlotMargins

PlotMargins JKQTBasePlotter::internalPlotMargins
protected

calculated value: description of free space between actual plot and widget borders

Note
This property is an intermediate storage for calculated values. Do not change directly!
See also
calcPlotMarginRect()

◆ internalPlotWidth

int JKQTBasePlotter::internalPlotWidth
protected

calculated value: plot width in pixel inside the widget (calculated by calcPlotScaling() from plotBorderLeft, plotBorderRight and widgetWidth)

See also
Plot Sizes & Borders

◆ internalTitleHeight

double JKQTBasePlotter::internalTitleHeight
protected

calculated value: height of the plot title (or 0 if no title)

Note
This property is an intermediate storage for calculated values. Do not change directly!

◆ jkqtpPaintDeviceAdapters

JKQTPSynchronized<QList<JKQTPPaintDeviceAdapter*> > JKQTBasePlotter::jkqtpPaintDeviceAdapters
staticprotected

◆ jkqtpSaveDataAdapters

JKQTPSynchronized<QList<JKQTPSaveDataAdapter*> > JKQTBasePlotter::jkqtpSaveDataAdapters
staticprotected

◆ lineWidthMultiplier

double JKQTBasePlotter::lineWidthMultiplier
protected

multiplier or the line widths

◆ lineWidthPrintMultiplier

double JKQTBasePlotter::lineWidthPrintMultiplier
protected

multiplier which is used for linewidths when the plot is exported/printed

◆ lstAdditionalPlotterActions

AdditionalActionsMap JKQTBasePlotter::lstAdditionalPlotterActions
protected

this list contains additional actions, that can be registered by registerAdditionalAction(). They are shown in the context menu only and are e.g. used to display "save image data" actions. Each action may be in a category (key of map), which is displayed as a submenu of the context-menu!

◆ m_plotsModel

JKQTPGraphsModel* JKQTBasePlotter::m_plotsModel
protected

model representing all Plots in this plotter and showing their visible/invisible state

◆ mainKey

JKQTPBaseKey* JKQTBasePlotter::mainKey
protected

key objects used for the main plot key

◆ maintainAspectRatio

bool JKQTBasePlotter::maintainAspectRatio
protected

indicates whether the widget should maintain an aspect ratio of plotwidth and plotheight

See also
aspectRatio

◆ maintainAxisAspectRatio

bool JKQTBasePlotter::maintainAxisAspectRatio
protected

indicates whether the axes should maintain an aspect ratio

When the axis aspect ratio is to be maintained and new axis ranges are set (e.g. when calling setXY() ), the given axis ranges are modified, so

\[ \mbox{axisAspectRatio}=\frac{\left|x_\text{max}-x_\text{min}\right|}{\left|y_\text{max}-y_\text{min}\right|} \]

Note
An axis aspect ratio is only well defined for linear axes (if both axes are linear). If both axes a logarithmic, the axis ration is defined for log(axismax)-log(axismin). For other combinations of axes, this function is deactivated
See also
axisAspectRatio

◆ masterPlotterX

JKQTBasePlotter* JKQTBasePlotter::masterPlotterX
protected

the master plotter for x-dimension, this plotter is connected to.

◆ masterPlotterY

JKQTBasePlotter* JKQTBasePlotter::masterPlotterY
protected

the master plotter for y-dimension, this plotter is connected to.

◆ masterSynchronizeHeight

bool JKQTBasePlotter::masterSynchronizeHeight
protected

synchronize plot height with masterPlotterY

◆ masterSynchronizeWidth

bool JKQTBasePlotter::masterSynchronizeWidth
protected

synchronize plot width with masterPlotterX

◆ mathText

JKQTMathText JKQTBasePlotter::mathText
protected

used to plot LaTeX markup

◆ paintMagnification

double JKQTBasePlotter::paintMagnification
protected

this is an internal property that is used by the export/print system to control the "magnification". Usually this is 1.0 but if set !=1.0, it is used to scale the widgetWidth and widgetHeight before painting!

◆ plotLabel

QString JKQTBasePlotter::plotLabel
protected

the plot label text

◆ plotterStyle

JKQTBasePlotterStyle JKQTBasePlotter::plotterStyle
protected

◆ printAspect

double JKQTBasePlotter::printAspect
private

◆ printDoUpdate

bool JKQTBasePlotter::printDoUpdate
private

◆ printKeepAbsoluteFontSizes

bool JKQTBasePlotter::printKeepAbsoluteFontSizes
private

◆ printKeepAspect

bool JKQTBasePlotter::printKeepAspect
private

◆ printMagnification

double JKQTBasePlotter::printMagnification
private

◆ printPageSizeMM

QSizeF JKQTBasePlotter::printPageSizeMM
private

◆ printPreview

QPointer<QPrintPreviewWidget> JKQTBasePlotter::printPreview
private

◆ printScaleToPagesize

bool JKQTBasePlotter::printScaleToPagesize
private

◆ printSetAbsolutePageSize

bool JKQTBasePlotter::printSetAbsolutePageSize
private

◆ printSetAbsolutePlotSize

bool JKQTBasePlotter::printSetAbsolutePlotSize
private

◆ printSizeX_Millimeter

double JKQTBasePlotter::printSizeX_Millimeter
private

◆ printSizeY_Millimeter

double JKQTBasePlotter::printSizeY_Millimeter
private

◆ printZoomFactor

double JKQTBasePlotter::printZoomFactor
private

◆ secondaryXAxis

QMap<JKQTPCoordinateAxisRef, JKQTPHorizontalAxisBase*> JKQTBasePlotter::secondaryXAxis
protected

objects used a secondary x-axes

◆ secondaryYAxis

QMap<JKQTPCoordinateAxisRef, JKQTPVerticalAxisBase*> JKQTBasePlotter::secondaryYAxis
protected

objects used a secondary y-axes

◆ spinMagnification

QPointer<JKQTPEnhancedDoubleSpinBox> JKQTBasePlotter::spinMagnification
private

◆ spinSizeX

QPointer<JKQTPEnhancedDoubleSpinBox> JKQTBasePlotter::spinSizeX
private

◆ spinSizeY

QPointer<JKQTPEnhancedDoubleSpinBox> JKQTBasePlotter::spinSizeY
private

◆ useClipping

bool JKQTBasePlotter::useClipping
protected

indicates whether to use clipping (hack for printing, see print() )

◆ usedStyles

QList<int> JKQTBasePlotter::usedStyles
protected

internal: used to store a list of all currently used plot styles

◆ userSettigsFilename

QString JKQTBasePlotter::userSettigsFilename
protected

filename for the ini file in which to save the user settings

See also
jkqtplotter_base_userprops

◆ userSettigsPrefix

QString JKQTBasePlotter::userSettigsPrefix
protected

prefix for the ini file in which to save the user settings

See also
jkqtplotter_base_userprops

◆ widgetHeight

int JKQTBasePlotter::widgetHeight
protected

height of the plot widget

See also
setWidgetSize(), Plot Sizes & Borders

◆ widgetWidth

int JKQTBasePlotter::widgetWidth
protected

width of the plot widget

See also
setWidgetSize(), Plot Sizes & Borders

◆ xAxis

JKQTPHorizontalAxis* JKQTBasePlotter::xAxis
protected

object used for the x-axis

◆ yAxis

JKQTPVerticalAxis* JKQTBasePlotter::yAxis
protected

object used for the y-axis


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