20#ifndef JKQTPBASEPLOTTER_H
21#define JKQTPBASEPLOTTER_H
23#include "jkqtplotter/jkqtplotter_configmacros.h"
25#include "jkqtplotter/jkqtptools.h"
26#include "jkqtplotter/jkqtpdatastorage.h"
27#include "jkqtplotter/jkqtpbaseplotterstyle.h"
28#include "jkqtplotter/jkqtpkey.h"
29#include "jkqtmathtext/jkqtmathtext.h"
30#include "jkqtplotter/jkqtpbaseelements.h"
31#include "jkqtcommon/jkqtpenhancedpainter.h"
32#include "jkqtcommon/jkqtpconcurrencytools.h"
33#include "jkqtplotter/gui/jkqtpenhancedspinboxes.h"
37#include <QActionGroup>
44#ifndef JKQTPLOTTER_COMPILE_WITHOUT_PRINTSUPPORT
46# include <QtPrintSupport/QPrintPreviewWidget>
48#include <QDoubleSpinBox>
57#include "jkqtplotter/jkqtplotter_imexport.h"
83 virtual void saveJKQTPData(
const QString& filename,
const QList<QVector<double> >& data,
const QStringList& columnNames)
const=0;
105 virtual QPaintDevice*
createPaintdevice(
const QString& filename,
int widthPix,
int heightPix)
const=0;
107 virtual QPaintDevice*
createPaintdeviceMM(
const QString& filename,
double widthMM,
double heightMM)
const;
531 return graphs.cbegin();
535 return graphs.cend();
539 return graphs.begin();
550 return graphs.begin();
606 template <
class TJKQTPGraphContainer>
607 inline void addGraphs(
const TJKQTPGraphContainer& gr, QVector<size_t>* graphIDsOut=
nullptr) {
608 for (
auto it=gr.begin(); it!=gr.end(); ++it) {
609 const auto id=addGraph(*it);
610 if (graphIDsOut) graphIDsOut->push_back(
id);
709 void loadSettings(
const QSettings& settings,
const QString& group=QString(
"plots/"));
715 void saveSettings(QSettings& settings,
const QString& group=QString(
"plots/"))
const;
749 void loadUserSettings(
const QSettings& settings,
const QString& group=QString(
"plots_user/"));
752 void saveUserSettings(QSettings& settings,
const QString& group=QString(
"plots_user/"))
const;
829 inline double didot2px(
double pt,
double dpi)
const {
830 return dpi/25.4*0.376*pt;
834 return didot2px(pt, painter.device()->logicalDpiX());
838 return didot2px(pt, painter.device()->logicalDpiX());
842 inline double pt2px(
double pt,
double dpi)
const {
847 return pt2px(pt, painter.device()->logicalDpiX());
851 return pt2px(pt, painter.device()->logicalDpiX());
855 inline double mm2px(
double mm,
double dpi)
const {
860 return mm2px(mm, painter.device()->logicalDpiX());
864 return mm2px(mm, painter.device()->logicalDpiX());
868 inline double x2p(
double x)
const {
869 return xAxis->x2p(x);
873 inline double y2p(
double y)
const {
874 return yAxis->x2p(y);
878 inline double p2x(
double x)
const {
879 return xAxis->p2x(x);
883 inline double p2y(
double y)
const {
884 return yAxis->p2x(y);
995 inline void redrawPlot() {
if (emitPlotSignals) emit plotUpdated(); }
1199 QMap<JKQTPCoordinateAxisRef, JKQTPHorizontalAxisBase*>
getXAxes(
bool includePrimary=
true);
1201 QMap<JKQTPCoordinateAxisRef, JKQTPVerticalAxisBase*>
getYAxes(
bool includePrimary=
true);
1203 QList<JKQTPCoordinateAxis*>
getAxes(
bool includePrimaries=
true);
1205 QList<const JKQTPCoordinateAxis*>
getAxes(
bool includePrimaries=
true)
const;
1300#ifndef JKQTPLOTTER_COMPILE_WITHOUT_PRINTSUPPORT
1414 explicit textSizeKey(
const QFont& f,
const QString& text, QPaintDevice *pd);
1415 explicit textSizeKey(
const QString& fontName,
double fontSize,
const QString& text, QPaintDevice *pd);
1433 void getTextSizeDetail(
const QString& fontName,
double fontSize,
const QString& text, QPainter &painter,
double& width,
double& ascent,
double& descent,
double& strikeoutPos);
1437 void getTextSizeDetail(
const QFont& fm,
const QString& text, QPainter &painter,
double& width,
double& ascent,
double& descent,
double& strikeoutPos);
1445 QSizeF
getTextSizeSize(
const QString& fontName,
double fontSize,
const QString& text, QPainter &painter);
1482 bool saveData(
const QString& filename=QString(
""),
const QString& format=QString(
""));
1620 void saveAsCSV(
const QString& filename,
const QString& decimalSeparator,
const QString& commentInitializer);
1637 void saveAsSemicolonSV(
const QString& filename,
const QString& decimalSeparator,
const QString& commentInitializer);
1653 void saveAsTabSV(
const QString& filename,
const QString& decimalSeparator,
const QString& commentInitializer);
1675 bool saveAsPixelImage(
const QString& filename=QString(
""),
bool displayPreview=
true,
const QByteArray &outputFormat=QByteArray(),
const QSize& outputSizeIncrease=QSize(0,0));
1685#ifndef JKQTPLOTTER_COMPILE_WITHOUT_PRINTSUPPORT
1694 bool saveAsSVG(
const QString& filename=QString(
""),
bool displayPreview=
true);
1704 bool saveAsPDF(
const QString& filename=QString(
""),
bool displayPreview=
true);
1719 bool saveImage(
const QString& filename=QString(
""),
bool displayPreview=
true);
1747#ifndef JKQTPLOTTER_COMPILE_WITHOUT_PRINTSUPPORT
1752 void print(QPrinter* printer=
nullptr,
bool displayPreview=
true);
1887 void setX(
double xminn,
double xmaxx,
bool affectsSecondaryAxes=
false);
1906 void setY(
double yminn,
double ymaxx,
bool affectsSecondaryAxes=
false);
1927 void setXY(
double xminn,
double xmaxx,
double yminn,
double ymaxx,
bool affectsSecondaryAxes=
false);
1933 inline void zoom(
double xminn,
double xmaxx,
double yminn,
double ymaxx,
bool affectsSecondaryAxes=
false) {
1934 setXY(xminn, xmaxx, yminn, ymaxx, affectsSecondaryAxes);
2058 void zoomToFit(
bool zoomX=
true,
bool zoomY=
true,
bool includeX0=
false,
bool includeY0=
false,
double scaleX=1.05,
double scaleY=1.05);
2258 bool printpreviewNew(QPaintDevice* paintDevice,
bool setAbsolutePaperSize=
false,
double printsizeX_inMM=-1.0,
double printsizeY_inMM=-1.0,
bool displayPreview=
true);
2283#ifndef JKQTPLOTTER_COMPILE_WITHOUT_PRINTSUPPORT
2489 muInnermost=muUsesCount-1
2508 inline PlotMargin(
double l=0,
double r=0,
double t=0,
double b=0) : left(l), right(r), top(t), bottom(b) {};
2737#ifndef JKQTPLOTTER_COMPILE_WITHOUT_PRINTSUPPORT
2801#ifndef JKQTPLOTTER_COMPILE_WITHOUT_PRINTSUPPORT
2827#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
represents a pen, when plotting in JKQTPlotter/JKQTBasePlotter
Definition jkqtpbaseplotter.h:764
void setSymbolFillColor(QColor c)
void setFillColor(const QColor &col)
Qt::BrushStyle m_errorFillStyle
Definition jkqtpbaseplotter.h:777
double m_symbolSize
Definition jkqtpbaseplotter.h:775
void setColor(const QColor &col)
QColor errorFillColor() const
Qt::PenStyle errorStyle() const
void setSymbolType(JKQTPGraphSymbols symbol)
void setFillStyle(const JKQTFillStyleSummmary &s)
QColor m_errorColor
Definition jkqtpbaseplotter.h:769
void setStyle(Qt::PenStyle s)
QColor errorColor() const
void setErrorLineWidth(double w)
void setSymbolSize(double w)
double m_width
Definition jkqtpbaseplotter.h:771
QColor m_color
Definition jkqtpbaseplotter.h:766
QColor m_symbolFillColor
Definition jkqtpbaseplotter.h:768
double symbolLineWidthF() const
JKQTFillStyleSummmary m_fillStyle
Definition jkqtpbaseplotter.h:776
void setErrorFillColor(const QColor &col)
void setErrorFillStyle(Qt::BrushStyle s)
Qt::PenStyle m_style
Definition jkqtpbaseplotter.h:774
JKQTFillStyleSummmary fillStyle() const
QColor symbolFillColor() const
JKQTPGraphSymbols symbol() const
void setSymbolLineWidthF(double w)
QColor m_fillColor
Definition jkqtpbaseplotter.h:767
double m_errorWidth
Definition jkqtpbaseplotter.h:772
double symbolSize() const
void setErrorLineColor(const QColor &col)
double m_symbolLineWidth
Definition jkqtpbaseplotter.h:773
Qt::PenStyle style() const
Qt::BrushStyle errorFillStyle() const
double errorWidthF() const
QColor m_errorFillColor
Definition jkqtpbaseplotter.h:770
JKQTPGraphSymbols m_symbol
Definition jkqtpbaseplotter.h:778
used for calculated value: describing all sections of freespace outside the graph area
Definition jkqtpbaseplotter.h:2530
double calcLeft() const
claculate size of plot margins on the left (sums all)
double calcTop() const
claculate size of plot margins at the top (sums all)
PlotMargins()
Definition jkqtpbaseplotter.h:2532
double calcTop(PlotMarginUse start, PlotMarginUse stop) const
double calcRight() const
claculate size of plot margins on the right (sums all)
double calcBottom() const
claculate size of plot margins at the bottom (sums all)
double calcBottom(PlotMarginUse start, PlotMarginUse stop) const
double calcRight(PlotMarginUse start, PlotMarginUse stop) const
double calcLeft(PlotMarginUse start, PlotMarginUse stop) const
base class for 2D plotter classes (used by the plotter widget JKQTPlotter)
Definition jkqtpbaseplotter.h:394
void initSettings()
set the standard settings (colors, line widths ...)
void printpreviewSetMagnificationNew(double value)
internal function for print preview
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)
Definition jkqtpbaseplotter.h:846
void setDefaultTextSize(double __value)
default font size in the plot [pt]
int widgetWidth
width of the plot widget
Definition jkqtpbaseplotter.h:2464
JKQTBasePlotterStyle plotterStyle
current style properties for this JKQTBasePlotter instance
Definition jkqtpbaseplotter.h:2391
void setMinorGridWidth(double __value)
sets the width of all minor grid lines
void setPlotLabelOffset(double __value)
offset of the plot label from the next element of the graph, i.e. below the label [pt].
void beforePlotScalingRecalculate()
emitted before the plot scaling has been recalculated
void moveGraphBottom(const JKQTPPlotElement *gr)
move the given graph gr to the bottom of all graphs
double internalPlotBorderLeft
calculated value: free space between widget top border and plot top border, as used to plot the graph
Definition jkqtpbaseplotter.h:2597
QRectF calcPlotMarginRect(PlotMarginUse use, PlotMarginSide side) const
calculate the rectangle to be used for a given PlotMarginUse on the indicated side of the plot
void setAspectRatio(double __value)
sets the data aspect ratio, enforced with setMaintainApsectRatio(true)
void useAsInternalDatastore(JKQTPDatastore *newStore)
tells the plotter object to use the given external datastore and treat it as an internal one (i....
double getLineWidthPrintMultiplier() const
multiplier which is used for linewidths when the plot is exported/printed
void setAbsoluteXY(double xminn, double xmaxx, double yminn, double ymaxx)
sets absolutely limiting x- and y-range of the plot
void setCurrentFileFormat(const QString &__value)
set the file format to use in SaveAs ... dialogs
double getPlotLabelFontSize() const
the plot label font size [pt]
void setPrintMagnification(double __value)
void showPlotData()
internal function for getDataColumnsByUser()
QMap< JKQTPCoordinateAxisRef, JKQTPHorizontalAxisBase * > secondaryXAxis
objects used a secondary x-axes
Definition jkqtpbaseplotter.h:2405
void setPlotBackgroundGradient(const QGradient &__value)
color of the plot's background (i.e. of the area within the coordinate axes rectangle)
QAction * getActionSaveSVG() const
QAction which triggers the saving as Scalable Vector Graphics (SVG)
QString getUserSettigsFilename() const
return the filename, used by loadUserSettings() and saveUserSettings()
void zoomIn(double factor=2.0)
zooms into 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.
QAction * getActionSaveCSV() const
QAction which triggers the saving as CSV (data only)
bool isUsingAntiAliasingForSystem() const
specifies whether to use antialiasing for plotting the coordinate system
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...
double getXMax() const
returns the current x-axis max of the primary x-axis
double fontSizePrintMultiplier
multiplier which is used for font sizes when the plot is exported/printed
Definition jkqtpbaseplotter.h:2701
QAction * actShowPlotData
QAction to show a table with all the plot data in the datastore.
Definition jkqtpbaseplotter.h:2756
double didot2px(double pt, JKQTPEnhancedPainter &painter) const
returns the given size in Didot points (0.376 mm) to pixels (with dpi from painter)
Definition jkqtpbaseplotter.h:833
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 setDefaultTextColor(QColor __value)
default text color in the plot
double getYMin() const
returns the current y-axis min of the primary y-axis
void setMaintainAspectRatio(bool value)
en-/disables the maintaining of the data aspect ratio
bool maintainAxisAspectRatio
indicates whether the axes should maintain an aspect ratio
Definition jkqtpbaseplotter.h:2670
double getAbsoluteYMax() const
returns the absolute y-axis max of the primary y-axis This is the highest allowed value the the axis ...
void printpreviewPaintRequestedNewPaintDevice(QPaintDevice *paintDevice)
internal function for print preview
void setGridColor(QColor color)
sets the color of all major grid lines (of the major x- and y-axis)
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)
Definition jkqtpbaseplotter.h:842
const JKQTPHorizontalAxisBase * getXAxis(JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) const
returns the x-axis objet of the plot
virtual ~JKQTBasePlotter()
class destructor
bool printScaleToPagesize
Definition jkqtpbaseplotter.h:2811
QPointer< JKQTPEnhancedDoubleSpinBox > spinSizeY
Definition jkqtpbaseplotter.h:2805
QAction * getActionCopyData() const
QAction which triggers copying of the data to the clipboard.
QSizeF gridPrintingSize
size of all plots in grid printing mode, filled by gridPrintingCalc()
Definition jkqtpbaseplotter.h:2446
void setUserSettigsPrefix(const QString &prefix)
set prefix, used by loadUserSettings() and saveUserSettings()
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 fil...
double getPlotLabelTopBorder() const
offset of the plot label from the top [pt].
void setLineWidthPrintMultiplier(double __value)
multiplier which is used for linewidths when the plot is exported/printed
void registerAdditionalAction(const QString &key, QAction *act)
this function registers additional actions to lstAdditionalPlotterActions, which are displayed in the...
void setUseAntiAliasingForSystem(bool __value)
specifies whether to use antialiasing for plotting the coordinate system
QString getUserSettigsPrefix() const
return the prefix, used by loadUserSettings() and saveUserSettings()
bool isUsingAntiAliasingForText() const
specifies whether to use antialiasing when drawing any text
void setPlotFrameVisible(bool enabled)
if true, JKQTBasePlotter will draw a rectangle/frame around the plot
bool isUsingAntiAliasingForGraphs() const
specifies whether to use antialiasing for plotting the graphs
bool doesMaintainAspectRatio() const
returns whether the maintaining of the data aspect ratio is enabled or disabled
void saveCurrentPlotterStyle(QSettings &settings, const QString &group="plots/") const
store the current style properties for this JKQTBasePlotter with properties loaded from settings
int getPlotWidth() const
calculated value: plot width in pixel inside the widget (calculated by calcPlotScaling() from plotBor...
Definition jkqtpbaseplotter.h:1153
QVector< JKQTPPlotElement * > GraphsList
Definition jkqtpbaseplotter.h:487
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)
Definition jkqtpbaseplotter.h:850
void calcPlotScaling(JKQTPEnhancedPainter &painter)
calculate the scaling and offset values from axis min/max values
QAction * getActionSavePlot() const
QAction which triggers saving of the plot as an image.
JKQTPDatastore * datastore
an object which manages all data columns for this plotter class
Definition jkqtpbaseplotter.h:2453
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 obje...
QString getPlotLabel() const
the plot label text
void drawSystemYAxis(JKQTPEnhancedPainter &painter)
plot the x coordinate axis (incl. labels)
PlotMargins internalPlotMargins
calculated value: description of free space between actual plot and widget borders
Definition jkqtpbaseplotter.h:2556
JKQTPHorizontalAxisBase * getXAxis(JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis)
returns the x-axis objet of the plot
void useExternalDatastore(JKQTPDatastore *newStore)
tells the plotter object to use the given external datastore.
size_t addGraph(JKQTPPlotElement *gr)
Definition jkqtpbaseplotter.h:566
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 printpreviewPaintRequested(QPrinter *printer)
internal function for print preview
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 fon...
void saveAsCSV(const QString &filename, const QString &decimalSeparator, const QString &commentInitializer)
save the current plot data as a Comma Separated Values (CSV) file
void setShowKey(bool __value)
indicates whether to plot a key
size_t gridPrintingCurrentY
y position of the current graph in grid printing
Definition jkqtpbaseplotter.h:2438
void setPlotBorderTop(int top)
sets the top border of the plot
void printpreviewSetSizeYNew(double value)
internal function for print preview
QList< size_t > gridPrintingRows
this list contains all the rows of the current grid printing and stores its heights
Definition jkqtpbaseplotter.h:2442
bool exportpreview(QSizeF pageSize, bool unitIsMM=false)
show the export preview window for a given page size pageSize, either in pixels (unitIsMM ==false ) o...
QAction * actZoomOut
QAction which triggers zoom out.
Definition jkqtpbaseplotter.h:2754
void setGridPrintingCurrentX(size_t __value)
x position of the current graph in grid printing
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 gridPrintingCalc()
This method goes through all registered plotters and calculates the width of every column and height ...
void drawSystemXAxis(JKQTPEnhancedPainter &painter)
plot the x coordinate axis (incl. labels)
double getInternalPlotBorderRight() const
calculated value: free space between widget top border and plot top border, as used to plot the graph
Definition jkqtpbaseplotter.h:1151
const JKQTPVerticalAxisBase * getYAxis(JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) const
returns the y-axis objet of the plot
void setShowZeroAxes(bool showX, bool showY)
switches the visibility of the zero-axes associated with the major x- and y-axis
int getPlotBorderLeft() const
free space between widget left border and plot left border, this property may be set by the user and ...
void setPlotFrameRounding(double __value)
if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot,...
void setOnlyNthGraphsVisible(int start, int n)
set all graphs invisible, except graph start, start+n, start+2*n, ...
void useInternalDatastore()
tells the plotter object to use an internal datastore. A new internal datastore object is generated o...
void setPlotFrameColor(QColor col)
if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this color
size_t getGridPrintingCurrentY() const
y position of the current graph in grid printing
void setExportBackgroundGradient(const QGradient &__value)
color of the background of the plot (widget area) when exporting
int internalPlotWidth
calculated value: plot width in pixel inside the widget (calculated by calcPlotScaling() from plotBor...
Definition jkqtpbaseplotter.h:2636
QString currentFileFormat
the current file format to use in SaveAs ... dialogs
Definition jkqtpbaseplotter.h:2762
void saveAsGerExcelCSV(const QString &filename=QString(""))
save the current plot data as a Semicolon Separated Values (CSV) file for german Excel,...
QBrush getBackgroundBrush() const
color of the background of the plot (widget area) when drawing (to the screen)
void setPlotLabelFontSize(double __value)
the plot label font size [pt]
QMapIterator< QString, QList< QPointer< QAction > > > AdditionalActionsMapIterator
Definition jkqtpbaseplotter.h:398
void printpreviewSetSizeX(double value)
internal function for print preview
static void registerPaintDeviceAdapter(JKQTPPaintDeviceAdapter *adapter)
register a user-defined QPaintDevice (with factory JKQTPPaintDeviceAdapter) as a plugin to JKQTBasePl...
double internalPlotBorderRight
calculated value: free space between widget top border and plot top border, as used to plot the graph
Definition jkqtpbaseplotter.h:2615
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)
Definition jkqtpbaseplotter.h:1933
void updatePreviewLabel()
internal function for print/export preview
QAction * actSavePlot
QAction which triggers saving of the plot as an image.
Definition jkqtpbaseplotter.h:2728
QAction * getActionCopyPixelImage() const
QAction which triggers copying of the image to the clipboard.
void beforePrinting()
emitted just before Printing the current plot as image, or just before the print preview dialog is sh...
void setMaintainAxisAspectRatio(bool value)
en-/disables the maintaining of the axis aspect ratio
void beforeExporting()
emitted just before exporting the current plot as image, or just before the export preview dialog is ...
void drawPlot(JKQTPEnhancedPainter &painter)
paints the plot onto the given JKQTPEnhancedPainter object
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
QAction * actSavePDF
QAction which triggers the saving as PDF.
Definition jkqtpbaseplotter.h:2739
double getAxisAspectRatio() const
returns the axis aspect ratio, enforced with setMaintainAxisApsectRatio(true)
QColor getPlotLabelColor() const
the plot label color
void setAllGraphsVisible()
set all graphs in the plotter visible
const JKQTMathText * getMathText() const
returns the internal JKQTMathText, used to render text with LaTeX markup
QList< const JKQTPCoordinateAxis * > getAxes(bool includePrimaries=true) const
returns all available x- or y-axes
void setExportBackgroundTexture(const QPixmap &__value)
color of the background of the plot (widget area) when exporting
double axisAspectRatio
the aspect ratio of axis widths to maintain, if maintainAxisAspectRatio==true
Definition jkqtpbaseplotter.h:2683
void setBackgroundTexture(const QImage &__value)
color of the background of the plot (widget area) when drawing (to the screen)
void setPlotLabelTopBorder(double __value)
offset of the plot label from the top [pt].
void setUseAntiAliasingForGraphs(bool __value)
specifies whether to use antialiasing for plotting the graphs
JKQTBasePlotter * masterPlotterY
the master plotter for y-dimension, this plotter is connected to.
Definition jkqtpbaseplotter.h:2771
QPointer< JKQTPEnhancedDoubleSpinBox > spinMagnification
Definition jkqtpbaseplotter.h:2807
void copyDataMatlab()
copy the data used for the current plot to the clipboard as a Matlab script
void getDataColumnsByUserComboBoxSelected(const QString &name)
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...
bool masterSynchronizeHeight
synchronize plot height with masterPlotterY
Definition jkqtpbaseplotter.h:2775
GraphsConstIterator cbeginGraphs() const
returns a const iterator to the first graph
Definition jkqtpbaseplotter.h:538
void setPlotBorderBottom(int bottom)
sets the bottom border of the plot
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)
double aspectRatio
the aspect ratio of plotwidth and plotheight to maintain, if maintainAspectRatio==true
Definition jkqtpbaseplotter.h:2656
double didot2px(JKQTPEnhancedPainter &painter, double pt) const
returns the given size in Didot points (0.376 mm) to pixels (with dpi from painter)
Definition jkqtpbaseplotter.h:837
QColor getPlotFrameColor() const
if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this color
void clearGraphs(bool deleteGraphs=true)
remove all plots
QBrush getExportBackgroundBrush() const
color of the background of the plot (widget area) when exporting
void printpreviewSetFontSizeMultiplier(double value)
internal function for print preview
QString getCSVdecimalSeparator() const
returns the decimal separator used when exporting data to text files
void setKeyPosition(const JKQTPKeyPosition &__value)
key position inside or besides the plot area, see JKQTPKeyPositions for details and examples
double paintMagnification
this is an internal property that is used by the export/print system to control the "magnification"....
Definition jkqtpbaseplotter.h:2450
QList< int > usedStyles
internal: used to store a list of all currently used plot styles
Definition jkqtpbaseplotter.h:2712
JKQTPKeyStyle & getMainKeyStyle()
retuns the JKQTPKeyStyle to be used for the main key (extracted from JKQTBasePlotterStyle::keyStyle)
bool isEmittingSignalsEnabled() const
returns whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate()
int widgetHeight
height of the plot widget
Definition jkqtpbaseplotter.h:2472
void setPlotBackgroundColor(const QColor &__value)
color of the plot's background (i.e. of the area within the coordinate axes rectangle)
void setMinorGridColor(QColor color)
sets the color of all minor grid lines (of the major x- and y-axis)
void setPlotLabel(const QString &__value)
set the plot label text
QString currentDataFileFormat
the current file format to use in SaveDataAs ... dialogs
Definition jkqtpbaseplotter.h:2764
void propagateStyle()
copy sub-properties of plotterStyle to sub-objects that require it (axes, axes in graphs ....
JKQTBasePlotter * masterPlotterX
the master plotter for x-dimension, this plotter is connected to.
Definition jkqtpbaseplotter.h:2769
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 pag...
const JKQTPPlotElement * getGraph(size_t i) const
returns description of i'th graph
bool useClipping
indicates whether to use clipping (hack for printing, see print() )
Definition jkqtpbaseplotter.h:2722
void saveAsDIF(const QString &filename=QString(""))
save the current plot data as a Data Interchange Format file (see https://en.wikipedia....
void printpreviewSetZoom(double value)
internal function for print preview
double x2p(double x) const
return x-pixel coordinate from x coordinate, using the primary axis
Definition jkqtpbaseplotter.h:868
QAction * actZoomIn
QAction which triggers zoom in.
Definition jkqtpbaseplotter.h:2752
JKQTMathText * getMathText()
returns the internal JKQTMathText, used to render text with LaTeX markup
double getAspectRatio() const
returns the data aspect ratio, enforced with setMaintainApsectRatio(true)
JKQTPPlotElement * getGraph(size_t i)
returns description of i'th graph
SynchronizationDirection
denotes, which axes to synchronize in synchronizeToMaster()
Definition jkqtpbaseplotter.h:1348
@ sdXAxis
x-axis only
Definition jkqtpbaseplotter.h:1349
@ sdYAxis
y-axis only
Definition jkqtpbaseplotter.h:1350
QRectF calcPlotRect() const
calculate the rectangle of the plot (excluding all margins)
QAction * actSavePix
QAction which triggers the saving as pixel image.
Definition jkqtpbaseplotter.h:2746
bool isPlotFrameVisible() const
if true, JKQTBasePlotter will draw a rectangle/frame around the plot
void plotScalingRecalculated()
emitted when the plot scaling had to be recalculated
QMap< JKQTPCoordinateAxisRef, JKQTPVerticalAxisBase * > getYAxes(bool includePrimary=true)
returns all available y-axes
void enableDebugShowTextBoxes(bool enabled=true)
if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the extent of ...
GraphsList & getGraphs()
returns a list of all graphs
Definition jkqtpbaseplotter.h:525
QAction * getActionZoomIn() const
QAction which triggers zoom in.
double getPlotLabelOffset() const
offset of the plot label from the next element of the graph, i.e. below the label [pt].
void setPlotFrameWidth(double __value)
if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this width ...
void moveGraphTop(const JKQTPPlotElement *gr)
move the given graph gr to the end of all graphs, so it is drawn
int getPlotBorderRight() const
free space between widget right border and plot right border, this property may be set by the user an...
void deleteGraph(JKQTPPlotElement *gr, bool deletegraph=true)
remove the given graph, if it is contained
static std::mutex globalUserSettingsMutex
Definition jkqtpbaseplotter.h:2784
bool printKeepAspect
Definition jkqtpbaseplotter.h:2813
int getPlotBorderTop() const
free space between widget top border and plot top border, this property may be set by the user and is...
void setGrid(bool val)
sets whether the major grid lines of the major axes are shown
void setAbsoluteX(double xminn, double xmaxx)
sets absolutely limiting x-range of the plot
bool printKeepAbsoluteFontSizes
Definition jkqtpbaseplotter.h:2810
JKQTMathText mathText
used to plot LaTeX markup
Definition jkqtpbaseplotter.h:2397
bool printDoUpdate
Definition jkqtpbaseplotter.h:2816
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 curre...
QColor getDefaultTextColor() const
default text color in the plot
double getPlotFrameWidth() const
if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot in this width ...
void setDefaultTextFontName(const QString &__value)
default font name in the plot
QAction * actCopyMatlab
QAction which triggers copying of the data to the clipboard in Matlab format.
Definition jkqtpbaseplotter.h:2736
void setPlotBackgroundTexture(const QImage &__value)
color of the plot's background (i.e. of the area within the coordinate axes rectangle)
void setUserSettigsFilename(const QString &filename, const QString &prefix)
set filename and prefix, used by loadUserSettings() and saveUserSettings()
double getYMax() const
returns the current y-axis max of the primary y-axis
void printpreviewSetSizeY(double value)
internal function for print preview
bool isDebugShowTextBoxesEnabled() const
if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the extent of ...
void drawPlotLabel(JKQTPEnhancedPainter &painter)
plot the plot label
void loadCurrentPlotterStyle(const QSettings &settings, const QString &group="plots/")
replace the current style properties for this JKQTBasePlotter with properties loaded from settings
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 objec...
void print(QPrinter *printer=nullptr, bool displayPreview=true)
print the current plot, if printer is nullptr a printer selection dialog is displayed
QSet< JKQTPCoordinateAxisRef > getAvailableXAxisRefs(bool includePrimary=false) const
returns the set of available x-axes (including the primary, if true is given as parameter)
bool emitSignals
specifies whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate...
Definition jkqtpbaseplotter.h:2698
const GraphsList & getGraphs() const
returns a const list of all graphs
Definition jkqtpbaseplotter.h:517
double printSizeY_Millimeter
Definition jkqtpbaseplotter.h:2799
QImage grabPixelImage(QSize size=QSize(), bool showPreview=false)
returns a rendering of the current plot as a QImage (pixel image) with the given size
std::function< bool(const JKQTPPlotElement *)> PlotElementPreciate
Functor which can be used as filter predicate for getGraphsXMinMax() or getGraphsYMinMax()
Definition jkqtpbaseplotter.h:649
void forceInternalDatastore()
tells the plotter object to use an internal datastore (just like useInternalDatastore() ),...
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 obje...
QString getCurrentSaveDirectory() const
returns the current directory in which to open SaveAs ... dialogs
void printpreviewToggleMagnification(bool checked)
internal function for print preview
void setShowZeroAxes(bool showXY)
switches the visibility of the zero-axes associated with the major x- and y-axis
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....
bool masterSynchronizeWidth
synchronize plot width with masterPlotterX
Definition jkqtpbaseplotter.h:2773
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 ...
void setPlotBorder(int left, int right, int top, int bottom)
sets the borders of the plot
JKQTPDatastore * getDatastore()
returns a pointer to the datastore used by this object
Definition jkqtpbaseplotter.h:449
QList< JKQTPCoordinateAxis * > getAxes(bool includePrimaries=true)
returns all available x- or y-axes
double y2p(double y) const
return y-pixel coordinate from y coordinate, using the primary axis
Definition jkqtpbaseplotter.h:873
double printSizeX_Millimeter
Definition jkqtpbaseplotter.h:2798
void setGridPrintingCurrentY(size_t __value)
y position of the current graph in grid printing
double internalPlotBorderBottom
calculated value: free space between widget top border and plot top border, as used to plot the graph
Definition jkqtpbaseplotter.h:2606
void getDataColumnsByUserCheckAll()
internal function for getDataColumnsByUser()
JKQTPBaseKey * mainKey
key objects used for the main plot key
Definition jkqtpbaseplotter.h:2412
QPointer< QLabel > exportPreviewLabel
Definition jkqtpbaseplotter.h:2806
int internalPlotHeight
calculated value: plot height in pixel inside the widget (calculated by calcPlotScaling() from plotBo...
Definition jkqtpbaseplotter.h:2643
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...
JKQTPGraphsModel * m_plotsModel
model representing all Plots in this plotter and showing their visible/invisible state
Definition jkqtpbaseplotter.h:2400
QList< JKQTPGridPrintingItem > gridPrintingList
list that manages all the additional graphs for grid printing mode
Definition jkqtpbaseplotter.h:2440
QString currentSaveDirectory
the current directory in which to open SaveAs ... dialogs
Definition jkqtpbaseplotter.h:2760
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
QSet< JKQTPCoordinateAxisRef > getAvailableYAxisRefs(bool includePrimary=false) const
returns the set of available y-axes (including the primary, if true is given as parameter)
void setWidgetWidth(int wid)
sets the width of the plot widget
QBrush getPlotBackgroundBrush() const
color of the plot's background (i.e. of the area within the coordinate axes rectangle)
static bool registerSaveDataAdapter(JKQTPSaveDataAdapter *adapter)
register a JKQTPSaveDataAdapter with JKQTPlotter/JKQTBasePlotter that can be used to export data from...
double mm2px(double mm, double dpi) const
returns the given size in millimeters to pixels (with given dots per inch)
Definition jkqtpbaseplotter.h:855
int getWidth()
gets the width of the plot widget
void setWidgetSize(QSize size)
resize the plot
void saveAsMatlab(const QString &filename=QString(""))
save the current plot data as a Matlab Script
JKQTPVerticalAxis * yAxis
object used for the y-axis
Definition jkqtpbaseplotter.h:2407
void setWidgetSize(int width, int height)
resize the plot
static QString globalUserSettigsFilename
Definition jkqtpbaseplotter.h:2782
GraphsConstIterator beginGraphs() const
returns a const iterator to the first graph
Definition jkqtpbaseplotter.h:530
QString userSettigsFilename
filename for the ini file in which to save the user settings
Definition jkqtpbaseplotter.h:2417
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,...
void setEmittingPlotSignalsEnabled(bool __value)
controls, whether the signals plotUpdated() are emitted
QAction * getActionSavePDF() const
QAction which triggers the saving as PDF.
double mm2px(double mm, JKQTPEnhancedPainter &painter) const
returns the given size in millimeters to pixels (with given dots per inch)
Definition jkqtpbaseplotter.h:859
QAction * getActionShowPlotData() const
QAction to show a table with all the plot data in the datastore.
QAction * actSaveSVG
QAction which triggers the saving as Scalable Vector Graphics (SVG)
Definition jkqtpbaseplotter.h:2741
QString getplotLabelFontName() const
the plot label font name
double printMagnification
Definition jkqtpbaseplotter.h:2800
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 alre...
QVector< JKQTPPlotElement * >::const_iterator GraphsConstIterator
Definition jkqtpbaseplotter.h:489
void addGraphs(const TJKQTPGraphContainer &gr, QVector< size_t > *graphIDsOut=nullptr)
add a new graphs from a QVector<JKQTPPlotElement*>, QList<JKQTPPlotElement*>, std::vector<JKQTPPlotEl...
Definition jkqtpbaseplotter.h:607
AdditionalActionsMap getLstAdditionalPlotterActions() const
this list contains additional actions, that can be registered by registerAdditionalAction()....
void saveAsCSV(const QString &filename=QString(""))
save the current plot data as a Comma Separated Values (CSV) file
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)
PlotMarginSide
enum to indicate relative position from a central position
Definition jkqtpbaseplotter.h:2492
@ sideLeft
Definition jkqtpbaseplotter.h:2493
@ sideTop
Definition jkqtpbaseplotter.h:2495
@ sideRight
Definition jkqtpbaseplotter.h:2494
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 setGridWidth(double __value)
sets the width of all Major grid lines
double mm2px(JKQTPEnhancedPainter &painter, double mm) const
returns the given size in millimeters to pixels (with given dots per inch)
Definition jkqtpbaseplotter.h:863
void setGraphInvisible(int i)
switch visibility of the i -th graph to visible
void plotUpdated()
emitted when the plot has to be updated
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
void setAbsoluteY(double yminn, double ymaxx)
sets absolute minimum and maximum y-value to plot
GraphsIterator beginGraphs()
returns an iterator to the first graph
Definition jkqtpbaseplotter.h:549
JKQTPBaseKey::KeySizeDescription internalPlotKeyDescription
calculated value: size and location of the plot key
Definition jkqtpbaseplotter.h:2624
void setFontSizeMultiplier(double __value)
multiplier for the font size
void setBackgroundGradient(const QGradient &__value)
color of the background of the plot (widget area) when drawing (to the screen)
void printpreviewPaintRequestedNewPrinter(QPrinter *printer)
internal function for print preview
void setOnlyGraphVisible(int i)
set all graphs invisible, except i
QMap< QString, QStringList > getDataColumnsByUserSaved
Definition jkqtpbaseplotter.h:2793
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)
QSet< int > getDataColumnsByUser()
void setWidgetHeight(int heigh)
sets the width of the plot widget
void setGraphVisible(int i, bool visible=true)
switch visibility of the i -th graph to visible
double getInternalPlotBorderLeft() const
calculated value: free space between widget top border and plot top border, as used to plot the graph
Definition jkqtpbaseplotter.h:1147
void moveGraphDown(int idx)
move the graph at position idx one item down (i.e. it is drawn earlier/lower in the z-stack)
QPointer< QPrintPreviewWidget > printPreview
Definition jkqtpbaseplotter.h:2802
void drawNonGrid(JKQTPEnhancedPainter &painter, const QRect &rect)
draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter
double getAbsoluteXMin() const
returns the absolute x-axis min of the primary x-axis. This is the lowest allowed value the the axis ...
double getInternalPlotBorderTop() const
calculated value: free space between widget top border and plot top border, as used to plot the graph
Definition jkqtpbaseplotter.h:1145
void clearGridPrintingPlotters()
clear all additional plotters for grid printing mode
void draw(JKQTPEnhancedPainter &painter, const QRect &rect)
draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter
AdditionalActionsMap lstAdditionalPlotterActions
this list contains additional actions, that can be registered by registerAdditionalAction()....
Definition jkqtpbaseplotter.h:2758
void setExportBackgroundTexture(const QImage &__value)
color of the background of the plot (widget area) when exporting
QMap< JKQTPCoordinateAxisRef, JKQTPHorizontalAxisBase * > getXAxes(bool includePrimary=true)
returns all available x-axes
double getAbsoluteXMax() const
returns the absolute x-axis max of the primary x-axis This is the highest allowed value the the axis ...
QString userSettigsPrefix
prefix for the ini file in which to save the user settings
Definition jkqtpbaseplotter.h:2421
void setUseAntiAliasingForText(bool __value)
specifies whether to use antialiasing when drawing any text
void setAxisAspectRatio(double __value)
sets the axis aspect ratio, enforced with setMaintainAxisApsectRatio(true)
static QString globalUserSettigsPrefix
Definition jkqtpbaseplotter.h:2783
void setBackgroundTexture(const QPixmap &__value)
color of the background of the plot (widget area) when drawing (to the screen)
const JKQTPBaseKey * getMainKey() const
retuns the main key object
void setBackgroundBrush(const QBrush &__value)
color of the background of the plot (widget area) when drawing (to the screen)
void exportpreviewPaintRequested(JKQTPEnhancedPainter &painter, QSize size)
internal function for export preview
void printpreviewSetSizeXNew(double value)
internal function for print preview
double p2x(double x) const
return x coordinate from x-pixel, using the primary axis
Definition jkqtpbaseplotter.h:878
double internalTitleHeight
calculated value: height of the plot title (or 0 if no title)
Definition jkqtpbaseplotter.h:2588
void getDataColumnsByUserCheckNone()
internal function for getDataColumnsByUser()
double getXMin() const
returns the current x-axis min of the primary x-axis
int getNextStyle()
gets the next unused style id, i.e. the smalles number >=0 which is not contained in usedStyles
QListWidget * dataColumnsListWidget
Definition jkqtpbaseplotter.h:2790
void setEmittingSignalsEnabled(bool enabled)
specifies whether this class emits signals, like zoomChangedLocally() or beforePlotScalingRecaluclate...
QAction * getActionZoomOut() const
QAction which triggers zoom out.
void moveGraphDown(const JKQTPPlotElement *gr)
move the given graph gr one item down (i.e. it is drawn earlier/lower in the z-stack)
bool hasYAxis(JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) const
returns whether a y-axis axis is registered with the plotter
void saveAsTabSV(const QString &filename=QString(""))
save the current plot data as a Tabulator Separated Values (CSV) file
bool doesMaintainAxisAspectRatio() const
returns whether the maintaining of the axis aspect ratio is enabled or disabled
void printpreviewSetLineWidthMultiplier(double value)
internal function for print preview
QAction * actSaveCSV
QAction which triggers the saving as CSV (data only)
Definition jkqtpbaseplotter.h:2748
void resetMasterSynchronization(SynchronizationDirection synchronizeDirection=sdXYAxes)
switches any synchronization off, that has been created by synchronizeToMaster()
double internalPlotBorderTop
calculated value: free space between widget top border and plot top border, as used to plot the graph
Definition jkqtpbaseplotter.h:2580
int getHeight()
gets the width of the plot widget
JKQTPPen getPlotStyle(int i, JKQTPPlotStyleType type=JKQTPPlotStyleType::Default) const
returns a QPen object for the i-th plot style
void setCSVcommentInitializer(const QString &__value)
set the string used to introduce comments in text output when exporting data
QColor getPlotBackgroundColor() const
color of the plot's background (i.e. of the area within the coordinate axes rectangle)
void deleteGraph(size_t i, bool deletegraph=true)
remove the i-th graph
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 fo...
void setCSVdecimalSeparator(const QString &__value)
set the decimal separator used when exporting data to text files
QString currentPrinter
the currently selected printer
Definition jkqtpbaseplotter.h:2766
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...
bool gridPrinting
indicates whether the grid printing is activated
Definition jkqtpbaseplotter.h:2428
QAction * actCopyPixelImage
QAction which triggers copying of the image to the clipboard.
Definition jkqtpbaseplotter.h:2734
void printpreviewUpdate()
internal function for print preview
void setPlotBackgroundTexture(const QPixmap &__value)
color of the plot's background (i.e. of the area within the coordinate axes rectangle)
bool datastoreInternal
indicates whether the datastore is managed (allocated/freed) internally or externally
Definition jkqtpbaseplotter.h:2455
JKQTPKeyPosition getKeyPosition() const
key position inside or besides the plot area, see JKQTPKeyPositions for details and examples
double fontSizeMultiplier
multiplier for the font size
Definition jkqtpbaseplotter.h:2707
QColor getBackgroundColor() const
color of the background of the plot (widget area) when drawing (to the screen)
size_t getGridPrintingCurrentX() const
x position of the current graph in grid printing
void setBackgroundColor(const QColor &__value)
color of the background of the plot (widget area) when drawing (to the screen)
void setGridPrintingCurrentPos(size_t x, size_t y)
set the x- and y-positions of this JKQTPlotter in the grid-printing grid
QAction * actPrint
QAction which triggers the printing.
Definition jkqtpbaseplotter.h:2743
void moveGraphUp(const JKQTPPlotElement *gr)
move the given graph gr one item up (i.e. it is drawn later/higher in the z-stack)
QString getDefaultTextFontName() const
default font name in the plot
double getDefaultTextSize() const
default font size in the plot [pt]
QPointer< JKQTPEnhancedDoubleSpinBox > spinSizeX
Definition jkqtpbaseplotter.h:2804
void setExportBackgroundBrush(const QBrush &__value)
color of the background of the plot (widget area) when exporting
void saveAsTabSV(const QString &filename, const QString &decimalSeparator, const QString &commentInitializer)
save the current plot data as a Tabulator Separated Values (CSV) file
bool printSetAbsolutePlotSize
Definition jkqtpbaseplotter.h:2809
bool emitPlotSignals
controls, whether the signals plotUpdated() are emitted
Definition jkqtpbaseplotter.h:2779
const JKQTPDatastore * getDatastore() const
returns a pointer to the datastore used by this object
Definition jkqtpbaseplotter.h:454
static void setDefaultJKQTBasePrinterUserSettings(QString userSettigsFilename, const QString &userSettigsPrefix)
set a global preset/default value for the userSettigsFilename and userSettigsPrefix properties of JKQ...
void saveAsSYLK(const QString &filename=QString(""))
save the current plot data as a SYmbolik LinK (SYLK) spreadsheet file (see https://en....
static void deregisterPaintDeviceAdapter(JKQTPPaintDeviceAdapter *adapter)
de-register a JKQTPPaintDeviceAdapter from JKQTBasePlotter/JKQTPlotter
QString getCurrentFileFormat() const
return the last file format to use in SaveAs ... dialogs
JKQTPHorizontalAxis * xAxis
object used for the x-axis
Definition jkqtpbaseplotter.h:2403
void printpreviewSetKeepAbsFontsize(bool checked)
internal function for print preview
void setPlotBorderLeft(int left)
sets the left border of the plot
JKQTPVerticalAxisBase * getYAxis(JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis)
returns the y-axis objet of the plot
bool isEmittingPlotSignalsEnabled() const
returns, whether the signals plotUpdated() are emitted
int getPlotBorderBottom() const
free space between widget bottom border and plot bottom border, this property may be set by the user ...
void setUserSettigsFilename(const QString &filename)
set filename, used by loadUserSettings() and saveUserSettings()
void moveGraphTop(int idx)
move the given graph to the top
void setPlotLabelColor(QColor __value)
the plot label color
void setGridStyle(Qt::PenStyle __value)
sets the style of all Major grid lines
bool isDebugShowRegionBoxesEnabled() const
if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the different ...
bool exportUnitInMM
Definition jkqtpbaseplotter.h:2814
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
double printAspect
Definition jkqtpbaseplotter.h:2812
QList< size_t > gridPrintingColumns
this list contains all the columns of the current grid printing and stores its widths
Definition jkqtpbaseplotter.h:2444
QAction * actZoomAll
QAction which triggers zoom all.
Definition jkqtpbaseplotter.h:2750
void setCurrentSaveDirectory(const QString &__value)
sets the current directory in which to open SaveAs ... dialogs
JKQTBasePlotter(bool datastore_internal, QObject *parent=nullptr, JKQTPDatastore *datast=nullptr)
class constructor
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 afterPrinting()
emitted just before Printing the current plot as image, or just before the print preview dialog is sh...
void getDataColumnsByUserItemChanged(QListWidgetItem *widgetitem)
internal function for getDataColumnsByUser()
void saveAsSemicolonSV(const QString &filename, const QString &decimalSeparator, const QString &commentInitializer)
save the current plot data as a Semicolon Separated Values (SSV) file
void redrawPlot()
emit plotUpdated(), which can be used by e.g. a widget class to update the displayed plot
Definition jkqtpbaseplotter.h:995
void printpreviewSetAspectRatio(bool checked)
internal function for print preview
void getDataColumnsByUserSave()
internal function for getDataColumnsByUser()
QSizeF printPageSizeMM
Definition jkqtpbaseplotter.h:2815
double lineWidthMultiplier
multiplier or the line widths
Definition jkqtpbaseplotter.h:2709
double getLineWidthMultiplier() const
multiplier or the line widths
size_t getGraphCount() const
returns the number of graphs
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.
QAction * getActionSaveData() const
QAction which triggers saving of the data used for the plot.
static JKQTPSynchronized< QList< JKQTPPaintDeviceAdapter * > > jkqtpPaintDeviceAdapters
Definition jkqtpbaseplotter.h:2785
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...
double lineWidthPrintMultiplier
multiplier which is used for linewidths when the plot is exported/printed
Definition jkqtpbaseplotter.h:2704
double getAbsoluteYMin() const
returns the absolute y-axis min of the primary y-axis This is the lowest allowed value the the axis m...
void drawSystemGrid(JKQTPEnhancedPainter &painter)
plot the grid
JKQTPCoordinateAxisRef addSecondaryXAxis(JKQTPHorizontalAxisBase *axis)
adds a secondary x-axis
void setFontSizePrintMultiplier(double __value)
multiplier which is used for font sizes when the plot is exported/printed
void setCurrentPlotterStyle(const JKQTBasePlotterStyle &style)
replace the current style properties for this JKQTBasePlotter
void updateSecondaryAxes()
updates the secondary axes
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)
JKQTPBaseKey * getMainKey()
retuns the main key object
void printpreviewSetMagnification(double value)
internal function for print preview
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...
QAction * getActionZoomAll() const
QAction which triggers zoom all.
void setMinorGridStyle(Qt::PenStyle __value)
sets the style of all minor grid lines
GraphsConstIterator endGraphs() const
returns a const iterator behind the last graph
Definition jkqtpbaseplotter.h:534
const JKQTPGraphsModel * getPlotsModel() const
returns model representing all Plots in this plotter and showing their visible/invisible state
Definition jkqtpbaseplotter.h:492
bool hasXAxis(JKQTPCoordinateAxisRef axis=JKQTPPrimaryAxis) const
returns whether an x-axis axis is registered with the plotter
void copyPixelImage(bool showPreview=true)
copy the current plot as a pixel+svg image to the clipboard
void drawKey(JKQTPEnhancedPainter &painter)
plot a key
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 fil...
void setplotLabelFontName(const QString &__value)
the plot label font name
void saveAsSemicolonSV(const QString &filename=QString(""))
save the current plot data as a Semicolon Separated Values (SSV) file
void addGridPrintingPlotter(size_t x, size_t y, JKQTBasePlotter *plotter)
add a new plotter for grid printing mode
void zoomOut(double factor=2.0)
zooms out of the graph (the same as turning the mouse wheel) by the given factor
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...
QVector< JKQTPPlotElement * >::iterator GraphsIterator
Definition jkqtpbaseplotter.h:488
void setAllGraphsInvisible()
set all graphs in the plotter invisible
double didot2px(double pt, double dpi) const
returns the given size in Didot points (0.376 mm) to pixels (with given dots per inch)
Definition jkqtpbaseplotter.h:829
double printZoomFactor
Definition jkqtpbaseplotter.h:2797
double getFontSizePrintMultiplier() const
multiplier which is used for font sizes when the plot is exported/printed
double getPrintMagnification() const
void setPaintMagnification(double __value)
this is an internal property that is used by the export/print system to control the "magnification"....
double getFontSizeMultiplier() const
multiplier for the font size
int getPlotHeight() const
calculated value: plot height in pixel inside the widget (calculated by calcPlotScaling() from plotBo...
Definition jkqtpbaseplotter.h:1155
JKQTPCoordinateAxisRef addSecondaryYAxis(JKQTPVerticalAxisBase *axis)
adds a secondary y-axis
QColor getExportBackgroundColor() const
color of the background of the plot (widget area) when exporting
bool printSetAbsolutePageSize
Definition jkqtpbaseplotter.h:2808
void copyData()
copy the data used for the current plot to the clipboard
void setLineWidthMultiplier(double __value)
multiplier or the line widths
bool getShowKey() const
indicates whether to plot a key
const JKQTPKeyStyle & getMainKeyStyle() const
retuns the JKQTPKeyStyle to be used for the main key (extracted from JKQTBasePlotterStyle::keyStyle)
QAction * actCopyData
QAction which triggers copying of the data to the clipboard.
Definition jkqtpbaseplotter.h:2732
void afterExporting()
emitted just before exporting the current plot as image, or just before the export preview dialog is ...
QAction * getActionPrint() const
QAction which triggers the printing.
size_t gridPrintingCurrentX
x position of the current graph in grid printing
Definition jkqtpbaseplotter.h:2433
void draw(JKQTPEnhancedPainter &painter, const QPoint &pos=QPoint(0, 0))
draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter
void setExportBackgroundColor(const QColor &__value)
color of the background of the plot (widget area) when exporting
GraphsIterator endGraphs()
returns an iterator behind the last graph
Definition jkqtpbaseplotter.h:556
double getPaintMagnification() const
this is an internal property that is used by the export/print system to control the "magnification"....
PlotMarginUse
used for calculated value:describing what freespace outside the graph area is used for
Definition jkqtpbaseplotter.h:2478
@ muPlotTitle
Definition jkqtpbaseplotter.h:2481
@ muUsesCount
Definition jkqtpbaseplotter.h:2488
@ muAxesOutside
Definition jkqtpbaseplotter.h:2485
@ muKey
Definition jkqtpbaseplotter.h:2482
@ muAxesOutsideExtend
Definition jkqtpbaseplotter.h:2484
@ muGraphsOutside
Definition jkqtpbaseplotter.h:2483
static JKQTPSynchronized< QList< JKQTPSaveDataAdapter * > > jkqtpSaveDataAdapters
Definition jkqtpbaseplotter.h:2786
void saveUserSettings() const
saves the plot user properties to the file sepcified by setUserSettigsFilename() and the prefix speci...
void enableDebugShowRegionBoxes(bool enabled=true)
if set true (default: false ) the JKQTBasePlotter draws colored rectangles to indicate the different ...
const JKQTBasePlotterStyle & getCurrentPlotterStyle() const
current style properties for this JKQTBasePlotter
QAction * getActionSavePix() const
QAction which triggers the saving as pixel image.
double getInternalPlotBorderBottom() const
calculated value: free space between widget top border and plot top border, as used to plot the graph
Definition jkqtpbaseplotter.h:1149
static bool deregisterSaveDataAdapter(JKQTPSaveDataAdapter *adapter)
de-register a JKQTPSaveDataAdapter from JKQTPlotter/JKQTBasePlotter
bool maintainAspectRatio
indicates whether the widget should maintain an aspect ratio of plotwidth and plotheight
Definition jkqtpbaseplotter.h:2649
GraphsList graphs
a vector that contains all graphs to be plottet in the system
Definition jkqtpbaseplotter.h:2716
QString plotLabel
the plot label text
Definition jkqtpbaseplotter.h:2687
bool containsGraph(const JKQTPPlotElement *gr) const
returns true, if the given graph is in this plot
void setPlotBackgroundBrush(const QBrush &__value)
color of the plot's background (i.e. of the area within the coordinate axes rectangle)
void deregisterAdditionalAction(QAction *act)
this function deregisters an additional action, previously added with registerAdditionalAction()
bool getGridPrinting() const
indicates whether the grid printing is activated
double getPlotFrameRounding() const
if plotFrameVisible==true, JKQTBasePlotter will draw a rectangle/frame around the plot,...
void setPlotBorderRight(int right)
sets the right border of the plot
QAction * getActionCopyMatlab() const
QAction which triggers copying of the data to the clipboard in Matlab format.
bool getMasterSynchronizeHeight() const
synchronize plot height with masterPlotterY
GraphsConstIterator cendGraphs() const
returns a const iterator behind the last graph
Definition jkqtpbaseplotter.h:542
QAction * actSaveData
QAction which triggers saving of the data used for the plot.
Definition jkqtpbaseplotter.h:2730
void drawNonGrid(JKQTPEnhancedPainter &painter, const QPoint &pos=QPoint(0, 0))
draw the contained graph (including grid prints) into the given JKQTPEnhancedPainter
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 ...
QString getCSVcommentInitializer() const
set the string used to introduce comments in text output when exporting data
QComboBox * dataColumnsCombobox
Definition jkqtpbaseplotter.h:2791
double p2y(double y) const
return y coordinate from y-pixel, using the primary axis
Definition jkqtpbaseplotter.h:883
bool getMasterSynchronizeWidth() const
synchronize plot width with masterPlotterX
QMap< JKQTPCoordinateAxisRef, JKQTPVerticalAxisBase * > secondaryYAxis
objects used a secondary y-axes
Definition jkqtpbaseplotter.h:2409
void loadUserSettings()
loads the plot user properties from the file sepcified by setUserSettigsFilename() and the prefix spe...
void setGridPrinting(bool __value)
indicates whether the grid printing is activated
JKQTPGraphsModel * getPlotsModel()
returns model representing all Plots in this plotter and showing their visible/invisible state
Definition jkqtpbaseplotter.h:495
void drawGraphs(JKQTPEnhancedPainter &painter)
plot the graphs in the order they appear in the list graphs, i.e. initially the order of the addGraph...
void moveGraphBottom(int idx)
move the given graph to the top
QMap< QString, QList< QPointer< QAction > > > AdditionalActionsMap
Definition jkqtpbaseplotter.h:397
Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of ...
Definition jkqtpbaseplotterstyle.h:47
Support Class for JKQTBasePlotter, which summarizes a fill style.
Definition jkqtpgraphsbasestyle.h:47
this class parses a mathematical markup string and can then draw the contained text/equation onto a Q...
Definition jkqtmathtext.h:192
base class for drawing a key (or legend)
Definition jkqtpkey.h:83
This class manages data columns (with entries of type double ), used by JKQTPlotter/JKQTBasePlotter t...
Definition jkqtpdatastorage.h:282
this class extends the QPainter
Definition jkqtpenhancedpainter.h:33
this virtual base class of the (data-column based) graphs, which are part of a JKQTPlotter plot and w...
Definition jkqtpgraphsbase.h:429
data model with all plots ina JKQTBasePlotter (+ allows to switch them visible/invisible)
Definition jkqtpgraphsmodel.h:41
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
Support Class for JKQTBasePlotter, which summarizes all properties that define the visual styling of ...
Definition jkqtpkeystyle.h:49
concrete class for drawing the main plot key (or legend). This class reads the key entries from the g...
Definition jkqtpkey.h:362
Service from this class to implement a special QPaintDevice as a plugin, that can be registered to JK...
Definition jkqtpbaseplotter.h:89
virtual double getPrintSizeXInMM() const =0
virtual QString getFilter() const =0
Filter-String for a Qt File-Dialog, e.g. "JPEG Files (*.jpg)"
virtual QString getFormatName() const =0
Human readable name for the format.
virtual ~JKQTPPaintDeviceAdapter()
Definition jkqtpbaseplotter.h:91
virtual double getPrintSizeYInMM() const =0
virtual QString getFormatID() const =0
a plugin-ID, i.e. a unique name for this format plugin, e.g. MyPluginExport_JPEG
virtual QStringList getFileExtension() const =0
returns a list (in lower-case) of the file extensions supported by this plugin, e....
virtual bool getSetAbsolutePaperSize() const =0
virtual QPaintDevice * createPaintdevice(const QString &filename, int widthPix, int heightPix) const =0
create a paint device with a given size in pt
virtual QPaintDevice * createPaintdeviceMM(const QString &filename, double widthMM, double heightMM) const
create a paint device with a given size in millimeters ... the default implementation call createPain...
virtual bool isPrinter() const =0
this virtual base class of every element, which is part of a JKQTPlotter plot and may appear in its k...
Definition jkqtpgraphsbase.h:62
virtual base-class for exporter classes that can be used to save data inot a file
Definition jkqtpbaseplotter.h:72
virtual QStringList getFileExtension() const =0
returns a list (in lower-case) of the file extensions supported by this plugin, e....
virtual ~JKQTPSaveDataAdapter()
virtual QString getFormatID() const =0
a plugin-ID, i.e. a unique name for this format plugin, e.g. MyPluginExport_MATLABMAT
virtual void saveJKQTPData(const QString &filename, const QList< QVector< double > > &data, const QStringList &columnNames) const =0
actually save the table data into file filename . The parameter columnNames provides a name for each ...
virtual QString getFilter() const =0
Filter-String for a Qt File-Dialog, e.g. "CSV Files (*.csv)"
template class that wraps any datatype and combines it with a mutex, exposes the lock()/unlock() inte...
Definition jkqtpconcurrencytools.h:40
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
JKQTPCoordinateAxes
named references for different oordinate axes in the plot
Definition jkqtpcoordinateaxes.h:42
QFlags< JKQTPKeyPositions > JKQTPKeyPosition
position of the key
Definition jkqtptools.h:607
#define JKQTPLOTTER_LIB_EXPORT
Definition jkqtplotter_imexport.h:89
JKQTPPlotStyleType
used to specify teh type of graph when calling getPlotStyle()
Definition jkqtptools.h:68
JKQTPLOTTER_LIB_EXPORT void initJKQTBasePlotterResources()
initialized Qt-ressources necessary for JKQTBasePlotter
size_t qHash(const JKQTBasePlotter::textSizeKey &data, size_t)
qHash()-specialization
Definition jkqtpbaseplotter.h:2828
@ JKQTPPrimaryAxis
Definition jkqtpcoordinateaxes.h:43
used for calculated value: describing a section in the freespace outside the graph area
Definition jkqtpbaseplotter.h:2502
PlotMargin(double l=0, double r=0, double t=0, double b=0)
Definition jkqtpbaseplotter.h:2508
double getMargin(PlotMarginSide side) const
select left,right, top, bottom, depending on side
Definition jkqtpbaseplotter.h:2511
double right
Definition jkqtpbaseplotter.h:2504
double left
Definition jkqtpbaseplotter.h:2503
double bottom
Definition jkqtpbaseplotter.h:2506
double top
Definition jkqtpbaseplotter.h:2505
Functor which does not apply any filter to JKQTPPlotElement, e.g. in getGraphsXMinMax() or getGraphsY...
Definition jkqtpbaseplotter.h:655
bool operator()(const JKQTPPlotElement *) const
Definition jkqtpbaseplotter.h:656
filter functor which accepts only those JKQTPPlotElement where JKQTPPlotElement::getXAxisRef() return...
Definition jkqtpbaseplotter.h:663
bool operator()(const JKQTPPlotElement *el) const
filterPlotElementByXAxis(JKQTPCoordinateAxisRef ref_)
Definition jkqtpbaseplotter.h:664
JKQTPCoordinateAxisRef ref
Definition jkqtpbaseplotter.h:667
filter functor which accepts only those JKQTPPlotElement where JKQTPPlotElement::getYAxisRef() return...
Definition jkqtpbaseplotter.h:674
JKQTPCoordinateAxisRef ref
Definition jkqtpbaseplotter.h:678
bool operator()(const JKQTPPlotElement *el) const
filterPlotElementByYAxis(JKQTPCoordinateAxisRef ref_)
Definition jkqtpbaseplotter.h:675
internal tool class for text-sizess in a plot key
Definition jkqtpbaseplotter.h:1413
int ldpiX
Definition jkqtpbaseplotter.h:1418
textSizeKey(const QString &fontName, double fontSize, const QString &text, QPaintDevice *pd)
QString text
Definition jkqtpbaseplotter.h:1416
QFont f
Definition jkqtpbaseplotter.h:1417
bool operator==(const textSizeKey &other) const
textSizeKey(const QFont &f, const QString &text, QPaintDevice *pd)
beschreibt die Größe(n) eines Knotens
Definition jkqtmathtexttools.h:393
struct, describing basic layout and size properties of a key/legend, mostly used as return value of g...
Definition jkqtpkey.h:119