open_iA 2025.6
Loading...
Searching...
No Matches
iAXYPlotData Class Reference

Holds data of a plot in the form of (x,y) value pairs. More...

#include <iAXYPlotData.h>

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

Public Member Functions

 iAXYPlotData (QString const &name, iAValueType type, size_t reservedSize)
 
- Public Member Functions inherited from iAPlotData
 iAPlotData (QString const &name, iAValueType type)
 Construct a plot data object.
 
virtual ~iAPlotData ()
 
QString const & name () const
 The name of the data series that this object holds.
 
virtual iAValueType valueType () const
 The type of the values held by this data object.
 
DataType xValue (size_t idx) const override
 
DataType yValue (size_t idx) const override
 Value on the y axis for a datum with given index.
 
DataType const * xBounds () const override
 The range of values for x; i.e. xBounds()[0] is the minimum of all xValue(...), xBounds()[1] is the maximum.
 
DataType const * yBounds () const override
 The range of values for y; i.e. yBounds()[0] is the minimum of all yValue(...), yBounds()[1] is the maximum.
 
size_t valueCount () const override
 The number of available data elements (i.e. in xValue/yValue, idx can go from 0 to valueCount()-1).
 
size_t nearestIdx (DataType dataX) const override
 Retrieve the index closest to the given x data value.
 
QString toolTipText (DataType dataX) const override
 The tooltip text for this data when the user is currently hovering over the given x position.
 
void addValue (DataType x, DataType y)
 Adds a new x/y pair. Note that entries need to be added in order of their x component.
 
static std::shared_ptr< iAXYPlotDatacreate (QString const &name, iAValueType type, size_t reservedSize)
 Create an empty data object.
 

Additional Inherited Members

- Public Types inherited from iAPlotData
using DataType = double
 Data type used for x and y values.
 

Detailed Description

Holds data of a plot in the form of (x,y) value pairs.

Constructor & Destructor Documentation

◆ iAXYPlotData()

iAXYPlotData::iAXYPlotData ( QString const & name,
iAValueType type,
size_t reservedSize )

Member Function Documentation

◆ addValue()

void iAXYPlotData::addValue ( iAPlotData::DataType x,
iAPlotData::DataType y )

Adds a new x/y pair. Note that entries need to be added in order of their x component.

◆ create()

std::shared_ptr< iAXYPlotData > iAXYPlotData::create ( QString const & name,
iAValueType type,
size_t reservedSize )
static

Create an empty data object.

◆ nearestIdx()

size_t iAXYPlotData::nearestIdx ( DataType dataX) const
overridevirtual

Retrieve the index closest to the given x data value.

Parameters
dataXthe value (on the x axis) for which to search the closest datapoint in this data object.
Returns
the index (such as can be passed to xValue/yValue) of the datapoint closest to dataX calling xValue on the returned index will always give a value lower than or equal to dataX.

Implements iAPlotData.

◆ toolTipText()

QString iAXYPlotData::toolTipText ( DataType dataX) const
overridevirtual

The tooltip text for this data when the user is currently hovering over the given x position.

Note that currently only the x axis position of the user is considered.

Parameters
dataXthe value (on the x axis) the user currently is hovering over.
Returns
a description of the datapoint that the user currrently is over/closest to.

Implements iAPlotData.

◆ valueCount()

size_t iAXYPlotData::valueCount ( ) const
overridevirtual

The number of available data elements (i.e. in xValue/yValue, idx can go from 0 to valueCount()-1).

Implements iAPlotData.

◆ xBounds()

iAPlotData::DataType const * iAXYPlotData::xBounds ( ) const
overridevirtual

The range of values for x; i.e. xBounds()[0] is the minimum of all xValue(...), xBounds()[1] is the maximum.

Implements iAPlotData.

◆ xValue()

iAPlotData::DataType iAXYPlotData::xValue ( size_t idx) const
overridevirtual

overriding methods from iAPlotData

Implements iAPlotData.

◆ yBounds()

iAPlotData::DataType const * iAXYPlotData::yBounds ( ) const
overridevirtual

The range of values for y; i.e. yBounds()[0] is the minimum of all yValue(...), yBounds()[1] is the maximum.

Implements iAPlotData.

◆ yValue()

iAPlotData::DataType iAXYPlotData::yValue ( size_t idx) const
overridevirtual

Value on the y axis for a datum with given index.

Parameters
idxdata index

Implements iAPlotData.


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