StackedBarChart

class StackedBarChart: public Chart

Implements a stacked bar chart.  A stacked bar chart contains a set of stacked bar data elements, grid lines, two axes and a headline label.

Inherits from Chart.

Summary
StackedBarChartImplements a stacked bar chart.
Functions
StackedBarChartInitializes the object.
~StackedBarChartReleases all allocated resources.
DrawDraws the chart.
DrawLabelsDraws the label assigned to the chart.
ChangePositionUnused function.
ChangeAlphaUnused function.
GetConnectedDataElementByDataGroupReturns the stacked bar which represents the given data group.
GetConnectedBarReturns the bar data element which represents the given data entry.
GetAllBarsReturns a vector containing all visible (not filtered) bars of all stacked bars of the chart.
GetHighestVisibleSumReturns the highest sum of values of a stacked bar among all visible (not filtered) stacked bars.
GetIndexOfBarReturns the index of a given bar in its stacked bar, counting from the bottom up.
GetVisibleDataGroupsReturns a vector containing all visible data groups of the given data groups, i.e.
ContainsDataEntryLookup function which checks the existence of a given data entry pointer in a given vector.

Functions

StackedBarChart

StackedBarChart(DataSet *pDataSet)

Initializes the object.

Parameters

pDataSetPointer to the data set object that shall be represented by the chart.

~StackedBarChart

~StackedBarChart()

Releases all allocated resources.

Draw

void Draw(QPainter *pPainter)

Draws the chart.  Inherited from AlterableObject.

Parameters

pPainterThe QPainter object that shall be used for painting.

DrawLabels

void DrawLabels(QPainter *pPainter)

Draws the label assigned to the chart.  Inherited from AlterableObject.

Parameters

pPainterThe QPainter object that shall be used for painting.

ChangePosition

void ChangePosition(float fDeltaLeft,
float fDeltaTop,
float fDeltaBottom)

Unused function.  Inherited from AlterableObject.

Parameters

fDeltaLeftUnused parameter.
fDeltaTopUnused parameter.
fDeltaBottomUnused parameter.

ChangeAlpha

void ChangeAlpha(float fDeltaAlpha)

Unused function.  Inherited from AlterableObject.

Parameters

fDeltaAlphaUnused parameter.

GetConnectedDataElementByDataGroup

DataElement* GetConnectedDataElementByDataGroup(DataGroup *pDataGroup)

Returns the stacked bar which represents the given data group.  If no such stacked bar exists, NULL is returned.

Parameters

pDataGroupPointer to the data group to be searched.

Returns

The stacked bar which represents the given data group if present, else NULL.

GetConnectedBar

DataElement* GetConnectedBar(DataEntry *pDataEntry)

Returns the bar data element which represents the given data entry.  If no such bar exists among all stacked bars, NULL is returned.

Parameters

pDataEntryPointer to the data entry to be searched.

Returns

The bar data element which represents the given data entry if present, else NULL.

GetAllBars

std::vector<DataElement*> GetAllBars()

Returns a vector containing all visible (not filtered) bars of all stacked bars of the chart.

Returns

A vector containing all visible bars of all stacked bars of the chart.

GetHighestVisibleSum

double GetHighestVisibleSum()

Returns the highest sum of values of a stacked bar among all visible (not filtered) stacked bars.

Returns

The highest sum of values of a stacked bar among all visible stacked bars.

GetIndexOfBar

unsigned int GetIndexOfBar(DataElement *pDataElement)

Returns the index of a given bar in its stacked bar, counting from the bottom up.

Parameters

pDataElementThe bar whose index is to be returned.

Returns

The index of a given bar in its stacked bar.

GetVisibleDataGroups

std::vector<DataGroup*> GetVisibleDataGroups(
   std::vector<DataGroup*> vAllDataGroups
)

Returns a vector containing all visible data groups of the given data groups, i.e. all data groups with at least one unfiltered data entry.

Parameters

vAllDataGroupsA vector containing all data groups of a data set.

Returns

A vector containing all visible data groups of the given data groups.

ContainsDataEntry

bool ContainsDataEntry(std::vector<DataEntry*> vDataEntries,
DataEntry *pDataEntry)

Lookup function which checks the existence of a given data entry pointer in a given vector.

Parameters

vDataEntriesA vector of data entry pointers.
pDataEntryA data entry pointer to be searched.

Returns

A boolean value indicating if the vector contains the data entry.

class StackedBarChart: public Chart
Implements a stacked bar chart.
StackedBarChart(DataSet *pDataSet)
Initializes the object.
~StackedBarChart()
Releases all allocated resources.
void Draw(QPainter *pPainter)
Draws the chart.
void DrawLabels(QPainter *pPainter)
Draws the label assigned to the chart.
void ChangePosition(float fDeltaLeft,
float fDeltaTop,
float fDeltaBottom)
Unused function.
void ChangeAlpha(float fDeltaAlpha)
Unused function.
DataElement* GetConnectedDataElementByDataGroup(DataGroup *pDataGroup)
Returns the stacked bar which represents the given data group.
DataElement* GetConnectedBar(DataEntry *pDataEntry)
Returns the bar data element which represents the given data entry.
std::vector<DataElement*> GetAllBars()
Returns a vector containing all visible (not filtered) bars of all stacked bars of the chart.
double GetHighestVisibleSum()
Returns the highest sum of values of a stacked bar among all visible (not filtered) stacked bars.
unsigned int GetIndexOfBar(DataElement *pDataElement)
Returns the index of a given bar in its stacked bar, counting from the bottom up.
std::vector<DataGroup*> GetVisibleDataGroups(
   std::vector<DataGroup*> vAllDataGroups
)
Returns a vector containing all visible data groups of the given data groups, i.e.
bool ContainsDataEntry(std::vector<DataEntry*> vDataEntries,
DataEntry *pDataEntry)
Lookup function which checks the existence of a given data entry pointer in a given vector.
class Chart: public AlterableObject
Abstract class that implements the skeleton of a chart.
class AlterableObject
Abstract class that implements the skeleton of an alterable object, i.e.
Close