CChartSerieBase< T > Class Template Reference

Base class for all series of the control. More...

#include <ChartSerieBase.h>

Inheritance diagram for CChartSerieBase< T >:

CChartSerie

List of all members.

Public Member Functions

void AddPoint (const T &newPoint)
 Adds a single data point to the series.
void AddPoints (T *pPoints, unsigned Count)
 Adds an array of points to the series.
const T & GetPoint (unsigned index) const
 Retrieves the point at the specified index.
void SetPoints (T *pPoints, unsigned Count)
 Sets an array of points to the series.
void RemovePointsFromBegin (unsigned Count)
 Removes a certain amount of points from the begining of the series.
void RemovePointsFromEnd (unsigned Count)
 Removes a certain amount of points from the end of the series.
void ClearSerie ()
 Removes all points from the series.
unsigned GetPointsCount () const
 Returns the number of points in the series.
bool GetSerieYMinMax (double &Min, double &Max) const
 Retrieves the minimum and maxium Y values of the series.
bool GetSerieXMinMax (double &Min, double &Max) const
 Retrieves the minimum and maxium X values of the series.
bool GetSerieXScreenMinMax (double &Min, double &Max) const
 Retrieves the minimum and maxium screen X values of the series.
bool GetSerieYScreenMinMax (double &Min, double &Max) const
 Retrieves the minimum and maxium screen Y values of the series.
CChartBalloonLabel< T > * CreateBalloonLabel (unsigned uPointIndex, const TChartString &strLabelText)
 Creates and attaches a balloon label on a point of the series.
CChartBalloonLabel< T > * CreateBalloonLabel (unsigned uPointIndex, CChartLabelProvider< T > *pLabelProvider)
 Creates and attaches a balloon label on a point of the series.
void AttachCustomLabel (unsigned uPointIndex, CChartLabel< T > *pLabel)
 Attaches a custom label on a point of the series.
 CChartSerieBase (CChartCtrl *pParent)
 Constructor.
virtual ~CChartSerieBase ()
 Destructor.
virtual void SetSeriesOrdering (PointsOrdering newOrdering)
 Specifies how the points should be ordered in the series.
CPoint GetPointScreenCoord (unsigned uPointIndex)
 Retrieves the screen point of a specific data point.
void RegisterMouseListener (CChartSeriesMouseListener< T > *pListener)
 Register a series mouse listener on this series.
void UnregisterMouseListener ()
 Unregister the series mouse listener for this series.

Protected Member Functions

bool GetVisiblePoints (unsigned &uFirst, unsigned &uLast) const
 Returns the first and last visible points of the series.
bool OnMouseEvent (CChartMouseListener::MouseEvent mouseEvent, const CPoint &screenPoint)
 Called by the control to check if an event occured on the series.

Protected Attributes

CChartPointsArray< T > m_vPoints
 The helper class containing all the data points.
unsigned m_uLastDrawnPoint
 Index of the last point drawn.


Detailed Description

template<class T>
class CChartSerieBase< T >

Base class for all series of the control.

This class inherits from CChartSeries and introduces the concept of points through the template parameter.

This class is much more than a simple base class. It already store all the data points and provide utility functions to manipulate them.


Member Function Documentation

template<class T>
void CChartSerieBase< T >::AddPoints ( T *  pPoints,
unsigned  Count 
) [inline]

Adds an array of points to the series.

Points which were already present in the series are kept.

Parameters:
pPoints Array of the new points
Count Size of the array

template<class T>
void CChartSerieBase< T >::AttachCustomLabel ( unsigned  uPointIndex,
CChartLabel< T > *  pLabel 
) [inline]

Attaches a custom label on a point of the series.

Parameters:
uPointIndex The index of the point on which the label should be attached
pLabel The label to attach to the point

template<class T>
CChartBalloonLabel< T > * CChartSerieBase< T >::CreateBalloonLabel ( unsigned  uPointIndex,
CChartLabelProvider< T > *  pLabelProvider 
) [inline]

Creates and attaches a balloon label on a point of the series.

This functions specifies a CChartLabelProvider object which is used to supply the text of the label. This is useful if you want more flexibility for the text of the label (display information about the point value for instance).

Parameters:
uPointIndex The index of the point on which the label should be attached
pLabelProvider Object providing the text displayed on the label
Returns:
the created CChartBalloonLabel

template<class T >
CChartBalloonLabel< T > * CChartSerieBase< T >::CreateBalloonLabel ( unsigned  uPointIndex,
const TChartString &  strLabelText 
) [inline]

Creates and attaches a balloon label on a point of the series.

This functions specifies a static text to display in the label.

Parameters:
uPointIndex The index of the point on which the label should be attached
strLabelText The text of the label
Returns:
the created CChartBalloonLabel

template<class T >
const T & CChartSerieBase< T >::GetPoint ( unsigned  index  )  const [inline]

Retrieves the point at the specified index.

Parameters:
index The index of the point to retrieve

template<class T >
CPoint CChartSerieBase< T >::GetPointScreenCoord ( unsigned  uPointIndex  )  [inline, virtual]

Retrieves the screen point of a specific data point.

Parameters:
uPointIndex The index of the point for which to retrieve the screen point
Returns:
the screen point

Implements CChartSerie.

template<class T >
bool CChartSerieBase< T >::GetSerieXMinMax ( double &  Min,
double &  Max 
) const [inline, virtual]

Retrieves the minimum and maxium X values of the series.

Parameters:
Min Minimum value will be stored in this parameter
Max Maximum value will be stored in this parameter
Returns:
false if the series doesn't contain data or is invisible

Implements CChartSerie.

template<class T >
bool CChartSerieBase< T >::GetSerieXScreenMinMax ( double &  Min,
double &  Max 
) const [inline, virtual]

Retrieves the minimum and maxium screen X values of the series.

Parameters:
Min Minimum value will be stored in this parameter
Max Maximum value will be stored in this parameter
Returns:
false if the series doesn't contain data or is invisible

Implements CChartSerie.

template<class T >
bool CChartSerieBase< T >::GetSerieYMinMax ( double &  Min,
double &  Max 
) const [inline, virtual]

Retrieves the minimum and maxium Y values of the series.

Parameters:
Min Minimum value will be stored in this parameter
Max Maximum value will be stored in this parameter
Returns:
false if the series doesn't contain data or is invisible

Implements CChartSerie.

template<class T >
bool CChartSerieBase< T >::GetSerieYScreenMinMax ( double &  Min,
double &  Max 
) const [inline, virtual]

Retrieves the minimum and maxium screen Y values of the series.

Parameters:
Min Minimum value will be stored in this parameter
Max Maximum value will be stored in this parameter
Returns:
false if the series doesn't contain data or is invisible

Implements CChartSerie.

template<class T >
bool CChartSerieBase< T >::GetVisiblePoints ( unsigned &  uFirst,
unsigned &  uLast 
) const [inline, protected, virtual]

Returns the first and last visible points of the series.

This function only works if ordering is enabled.

Parameters:
uFirst The index of the first visible point is stored in this argument
uLast The index of the last visible point is stored in this argument
Returns:
false if the series has no ordering or no data points.

Implements CChartSerie.

template<class T>
void CChartSerieBase< T >::RegisterMouseListener ( CChartSeriesMouseListener< T > *  pListener  )  [inline]

Register a series mouse listener on this series.

Parameters:
pListener The listener to register

template<class T>
void CChartSerieBase< T >::SetPoints ( T *  pPoints,
unsigned  Count 
) [inline]

Sets an array of points to the series.

Points which were already present in the series are discarded.

Parameters:
pPoints Array of the new points
Count Size of the array

template<class T >
void CChartSerieBase< T >::SetSeriesOrdering ( PointsOrdering  newOrdering  )  [inline, virtual]

Specifies how the points should be ordered in the series.

This specifies if the points should be ordered on their X values, on their Y values or not ordered (kept in order they are added to the control). Ordering can improve performances a lot but makes it impossible to draw some specific curves (for instance, drawing an ellipse is only possible if no ordering is set).

Reimplemented in CChartSurfaceSerie.


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

Generated on Sun Jan 17 13:33:11 2010 for ChartDemo by  doxygen 1.5.8