CartesianPlot

This class implements the cartesian plot and the actual plot area that is visualized on the Worksheet.

Public Types

  • enum BorderTypeFlags

  • enum MouseMode

  • enum NavigationOperation

  • enum PlotColorMode

  • enum RangeBreakStyle

  • enum RangeType

  • enum Type

Public Methods

void

CartesianPlot(const QString &name, bool loading=false)

void

addCoordinateSystem()

void

addCoordinateSystem(CartesianCoordinateSystem *cSystem)

void

addLegend(CartesianPlotLegend *)

QMenu*

addNewMenu()

void

addXRange()

void

addXRange(const Range< double > &)

void

addYRange()

void

addYRange(const Range< double > &)

QMenu*

analysisMenu()

bool

autoScale(const Dimension, int index=-1) const

Background*

background() const

Line*

borderLine() const

int

cSystemIndex(WorksheetElement *e)

CartesianCoordinateSystem*

coordinateSystem(int) const

int

coordinateSystemCount() const

QMenu*

createContextMenu() override

Line*

cursorLine() const

double

cursorPos(int cursorNumber) const

int

curveChildIndex(const WorksheetElement *) const

int

curveCount() const

const Range< double >&

dataRange(const Dimension, int index=-1)

QRectF

dataRect() const

CartesianCoordinateSystem*

defaultCoordinateSystem() const

QVector< AbstractAspect* >

dependsOn() const override

void

enableAutoScale(const Dimension, int index, bool enable, bool fullRange=false)

void

fillAddNewPlotMenu(QMenu *, QActionGroup *)

void

fillAnalysisMenu(QMenu *, QActionGroup *)

void

fillDistributionFitMenu(QMenu *, QActionGroup *)

void

fillFitMenu(QMenu *, QActionGroup *)

const XYCurve*

getCurve(int index) const

Axis*

horizontalAxis() const

QIcon

icon() const override

bool

isPanningActive() const

bool

isPrinted() const

bool

isSelected() const

bool

load(XmlStreamReader *, bool preview) override

void

loadThemeConfig(const KConfig &) override

void

mouseHoverOutsideDataRect()

void

mouseHoverZoomSelectionMode(QPointF logicPos, int cSystemIndex)

MouseMode

mouseMode() const

void

mouseMoveCursorMode(int cursorNumber, QPointF logicPos)

void

mouseMoveSelectionMode(QPointF logicStart, QPointF logicEnd)

void

mouseMoveZoomSelectionMode(QPointF logicPos, int cSystemIndex)

void

mousePressCursorMode(int cursorNumber, QPointF logicPos)

void

mousePressZoomSelectionMode(QPointF logicPos, int cSystemIndex)

void

mouseReleaseZoomSelectionMode(int cSystemIndex)

void

navigate(int cSystemIndex, NavigationOperation)

QVector< AspectType >

pasteTypes() const override

const QColor

plotColor(int index) const

const QList< QColor >&

plotColors() const

void

processDropEvent(const QVector< quintptr > &) override

const Range< double >&

range(const Dimension, int index=-1) const

int

rangeCount(const Dimension) const

const QString

rangeDateTimeFormat(const Dimension) const

const QString

rangeDateTimeFormat(const Dimension, const int index) const

bool

rangeDirty(const Dimension, int index) const

RangeT::Format

rangeFormat(const Dimension, const int) const

RangeT::Scale

rangeScale(const Dimension, const int index) const

void

removeCoordinateSystem(int index)

void

removeRange(const Dimension, int index)

void

resizeInsetPlot(CartesianPlot *)

void

retransformScale(Dimension, int index)

void

retransformScales()

void

save(QXmlStreamWriter *) const override

void

saveTheme(KConfig &config)

void

setCoordinateSystemRangeIndex(int cSystemIndex, Dimension, int rangeIndex)

void

setMax(const Dimension, int index, double)

void

setMin(const Dimension, int index, double)

void

setMouseMode(MouseMode)

void

setPrevRect(const QRectF &) override

void

setRange(const Dimension, const int index, const Range< double > &range)

void

setRangeDefault(const Dimension, const Range< double >)

void

setRangeDirty(const Dimension, int index, bool dirty)

void

setRangeFormat(const Dimension, const RangeT::Format)

void

setRangeFormat(const Dimension, const int, const RangeT::Format)

void

setRangeScale(const Dimension, const int index, const RangeT::Scale scale)

void

setRect(const QRectF &) override

void

setType(Type type)

void

setXRange(int index, const Range< double > &)

void

setYRange(int index, const Range< double > &)

QString

theme() const

Type

type() const

Axis*

verticalAxis() const

void

wheelEvent(const QPointF &sceneRelPos, int delta, int xIndex, int yIndex, bool considerDimension, Dimension dim)

RangeT::Format

xRangeFormatDefault() const

RangeT::Format

yRangeFormatDefault() const

Detailed Description

class CartesianPlot : public AbstractPlot

This class implements the cartesian plot and the actual plot area that is visualized on the Worksheet.

The definition of the cartesian coordinate systems as well as of the to be plotted data ranges is done in this class.

Public Functions

void setType(Type type)

initializes all children of CartesianPlot and setups a default plot of type type with a plot title.

virtual QIcon icon() const override

Returns an icon to be used in the project explorer.

virtual QMenu *createContextMenu() override

Return a new context menu.

The caller takes ownership of the menu.

virtual QVector<AbstractAspect*> dependsOn() const override

returns the list of all parent aspects (folders and sub-folders)

virtual QVector<AspectType> pasteTypes() const override

return the list of all aspect types that can be copy&pasted into the current aspect. returns an empty list on default, needs to be re-implemented in all derived classes that want to allow other aspects to be pasted into.

QRectF dataRect() const

returns the actual bounding rectangular of the plot area showing data (plot’s rectangular minus padding) in plot’s coordinates

Axis *horizontalAxis() const

returns the first horizontal axis on the plot area, usually used to set the axis title for the plot area and in case multiple axes of the same orientation are present.

Axis *verticalAxis() const

returns the first horizontal axis on the plot area, usually used to set the axis title for the plot area and in case multiple axes of the same orientation are present.

void addLegend(CartesianPlotLegend*)

public helper function to set a legend object created outside of CartesianPlot, e.g. in OriginProjectParser.

int curveChildIndex(const WorksheetElement*) const

returns the index of the child curve in the list of all “curve-like” children (xy-curve, histogram, boxplot, etc.). This function is used when applying the theme color to the newly added “curve”.:

virtual void save(QXmlStreamWriter*) const override

Save as XML.

virtual bool load(XmlStreamReader*, bool preview) override

Load from XML.

void resizeInsetPlot(CartesianPlot*)

sets the size of the inset plot to 30% of the parent plot’s size and allows to resize it with the mouse (not controlled by worksheet’s layout)

Public Slots

void shift(int index, const Dimension, bool leftOrDown)

helper function called in other shift*() functions and doing the actual change of the data ranges.

Parameters:
  • x – if set to \true the x-range is modified, the y-range for false

  • leftOrDown – the “shift left” for x or “shift down” for y is performed if set to \true , “shift right” or “shift up” for false

void dataChanged(int xIndex = -1, int yIndex = -1, WorksheetElement *sender = nullptr)

called when in one of the curves the data was changed. Autoscales the coordinate system and the x-axes, when “auto-scale” is active.

struct RangeBreak
struct RangeBreaks