TouchCPLib  1.0.0
A touch-enabled GUI interface based on SDL and libTS. It provides a simple desktop-free UI for your embedded Raspberry projects.
XYPlot Class Reference

A chart displaying X,Y points, scaled to the object geomtry. More...

#include <XYPlot.h>

Inheritance diagram for XYPlot:
Collaboration diagram for XYPlot:

Public Member Functions

 XYPlot ()
 
 ~XYPlot ()
 
void setData (const std::vector< float > &xValues, const std::vector< float > &yValues)
 Set the data points. More...
 
void setXMinMax (const Optional< std::pair< float, float >> &xMinMax)
 Set the X axis minimum and maximum. If unset, it will use the minimum and maximum from the dataset. More...
 
void setYXMinMax (const Optional< std::pair< float, float >> &yMinMax)
 Set the Y axis minimum and maximum. If unset, it will use the minimum and maximum from the dataset. More...
 
void setGeometry (Rect r)
 Set the chart geometry (position and size) More...
 
void setBackgroundColor (const Color bgColor)
 Set the background color. More...
 
void setLineColor (const Color lnColor)
 Set the points color (it will also be used for the chart outline) More...
 
void draw (uint32_t time) override
 The draw method. It will be called once per frame for each object in a scene. More...
 
int getX () const override
 
int getY () const override
 
int getWidth () const override
 
int getHeight () const override
 
- Public Member Functions inherited from InteractiveGraphicsObject
virtual ~InteractiveGraphicsObject ()=default
 
- Public Member Functions inherited from GraphicsObject
virtual ~GraphicsObject ()=default
 
bool isVisible () const
 
void setVisibility (bool visible)
 
- Public Member Functions inherited from TouchEnabledObject
TouchCallback getTouchCallback () const
 
void setTouchCallback (TouchCallback cb)
 Set the touch interaction callback. More...
 
bool isTouchEnabled () const
 True if the object reacts to touch events. More...
 
void setTouchEnabled (bool enabled)
 Set if the object has to react to touch events. More...
 
bool isPropagateInteraction () const
 True if the object will call the handlers of object placed below when touched. More...
 
void setPropagateInteraction (bool propagate)
 Set wheter the object has to call the handlers of objects placed below, when touched. More...
 

Detailed Description

A chart displaying X,Y points, scaled to the object geomtry.

Constructor & Destructor Documentation

◆ XYPlot()

XYPlot::XYPlot ( )

◆ ~XYPlot()

XYPlot::~XYPlot ( )

Member Function Documentation

◆ draw()

void XYPlot::draw ( uint32_t  time)
overridevirtual

The draw method. It will be called once per frame for each object in a scene.

Parameters
timeA time parameter (as given by SDL_GetTicks) for time-based animation purposes

Implements GraphicsObject.

◆ getHeight()

int XYPlot::getHeight ( ) const
overridevirtual

Implements TouchEnabledObject.

◆ getWidth()

int XYPlot::getWidth ( ) const
overridevirtual

Implements TouchEnabledObject.

◆ getX()

int XYPlot::getX ( ) const
overridevirtual

Implements TouchEnabledObject.

◆ getY()

int XYPlot::getY ( ) const
overridevirtual

Implements TouchEnabledObject.

◆ setBackgroundColor()

void XYPlot::setBackgroundColor ( const Color  bgColor)

Set the background color.

Parameters
bgColorThe background color

◆ setData()

void XYPlot::setData ( const std::vector< float > &  xValues,
const std::vector< float > &  yValues 
)

Set the data points.

Parameters
xValuesThe X points
yValuesThe Y points

◆ setGeometry()

void XYPlot::setGeometry ( Rect  r)

Set the chart geometry (position and size)

Parameters
rThe chart geometry

◆ setLineColor()

void XYPlot::setLineColor ( const Color  lnColor)

Set the points color (it will also be used for the chart outline)

Parameters
lnColorThe points color

◆ setXMinMax()

void XYPlot::setXMinMax ( const Optional< std::pair< float, float >> &  xMinMax)

Set the X axis minimum and maximum. If unset, it will use the minimum and maximum from the dataset.

Parameters
xMinMaxAn optional pair of minimum, maximum values

◆ setYXMinMax()

void XYPlot::setYXMinMax ( const Optional< std::pair< float, float >> &  yMinMax)

Set the Y axis minimum and maximum. If unset, it will use the minimum and maximum from the dataset.

Parameters
yMinMaxAn optional pair of minimum, maximum values

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