LibreOffice Module sc (master) 1
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | List of all members
sc::SparklineValues Class Reference

Contains and manages the values of the sparkline. More...

#include <SparklineRenderer.hxx>

Public Member Functions

std::vector< SparklineValue > const & getValuesList () const
void add (double fValue, SparklineValue::Action eAction)
void interpolatePastValues (double nCurrentValue, size_t nCurrentIndex)
void convertToStacked ()
void reverse ()

Static Public Member Functions

static constexpr double interpolate (double x1, double y1, double x2, double y2, double x)

Public Attributes

size_t mnFirstIndex = std::numeric_limits<size_t>::max()
size_t mnLastIndex = 0
double mfMinimum = std::numeric_limits<double>::max()
double mfMaximum = std::numeric_limits<double>::min()

Private Attributes

double mfPreviousValue = 0.0
size_t mnPreviousIndex = std::numeric_limits<size_t>::max()
std::vector< size_t > maToInterpolateIndex
std::vector< SparklineValuemaValueList

Detailed Description

Contains and manages the values of the sparkline.

It automatically keeps track of the minimums and maximums, and skips or interpolates the sparkline values if needed, depending on the input. This is done so it is easier to handle the sparkline values later on.

Definition at line 60 of file SparklineRenderer.hxx.

Member Function Documentation

◆ add()

void sc::SparklineValues::add ( double  fValue,
SparklineValue::Action  eAction 

◆ convertToStacked()

void sc::SparklineValues::convertToStacked ( )

Definition at line 142 of file SparklineRenderer.hxx.

References maValueList, mfMaximum, and mfMinimum.

Referenced by sc::SparklineRenderer::render().

◆ getValuesList()

std::vector< SparklineValue > const & sc::SparklineValues::getValuesList ( ) const

◆ interpolate()

static constexpr double sc::SparklineValues::interpolate ( double  x1,
double  y1,
double  x2,
double  y2,
double  x 

Definition at line 109 of file SparklineRenderer.hxx.

References x.

Referenced by interpolatePastValues().

◆ interpolatePastValues()

void sc::SparklineValues::interpolatePastValues ( double  nCurrentValue,
size_t  nCurrentIndex 

◆ reverse()

void sc::SparklineValues::reverse ( )

Definition at line 164 of file SparklineRenderer.hxx.

References maValueList.

Referenced by sc::SparklineRenderer::render().

Member Data Documentation

◆ maToInterpolateIndex

std::vector<size_t> sc::SparklineValues::maToInterpolateIndex

Definition at line 66 of file SparklineRenderer.hxx.

Referenced by add(), and interpolatePastValues().

◆ maValueList

std::vector<SparklineValue> sc::SparklineValues::maValueList

◆ mfMaximum

double sc::SparklineValues::mfMaximum = std::numeric_limits<double>::min()

◆ mfMinimum

double sc::SparklineValues::mfMinimum = std::numeric_limits<double>::max()

◆ mfPreviousValue

double sc::SparklineValues::mfPreviousValue = 0.0

Definition at line 63 of file SparklineRenderer.hxx.

Referenced by add(), and interpolatePastValues().

◆ mnFirstIndex

size_t sc::SparklineValues::mnFirstIndex = std::numeric_limits<size_t>::max()

◆ mnLastIndex

size_t sc::SparklineValues::mnLastIndex = 0

◆ mnPreviousIndex

size_t sc::SparklineValues::mnPreviousIndex = std::numeric_limits<size_t>::max()

Definition at line 64 of file SparklineRenderer.hxx.

Referenced by add(), and interpolatePastValues().

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