#include <ChartSerieBase.h>
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. |
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.
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.
pPoints | Array of the new points | |
Count | Size of the array |
void CChartSerieBase< T >::AttachCustomLabel | ( | unsigned | uPointIndex, | |
CChartLabel< T > * | pLabel | |||
) | [inline] |
Attaches a custom label on a point of the series.
uPointIndex | The index of the point on which the label should be attached | |
pLabel | The label to attach to the point |
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).
uPointIndex | The index of the point on which the label should be attached | |
pLabelProvider | Object providing the text displayed on the label |
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.
uPointIndex | The index of the point on which the label should be attached | |
strLabelText | The text of the label |
const T & CChartSerieBase< T >::GetPoint | ( | unsigned | index | ) | const [inline] |
Retrieves the point at the specified index.
index | The index of the point to retrieve |
CPoint CChartSerieBase< T >::GetPointScreenCoord | ( | unsigned | uPointIndex | ) | [inline, virtual] |
Retrieves the screen point of a specific data point.
uPointIndex | The index of the point for which to retrieve the screen point |
Implements CChartSerie.
bool CChartSerieBase< T >::GetSerieXMinMax | ( | double & | Min, | |
double & | Max | |||
) | const [inline, virtual] |
Retrieves the minimum and maxium X values of the series.
Min | Minimum value will be stored in this parameter | |
Max | Maximum value will be stored in this parameter |
Implements CChartSerie.
bool CChartSerieBase< T >::GetSerieXScreenMinMax | ( | double & | Min, | |
double & | Max | |||
) | const [inline, virtual] |
Retrieves the minimum and maxium screen X values of the series.
Min | Minimum value will be stored in this parameter | |
Max | Maximum value will be stored in this parameter |
Implements CChartSerie.
bool CChartSerieBase< T >::GetSerieYMinMax | ( | double & | Min, | |
double & | Max | |||
) | const [inline, virtual] |
Retrieves the minimum and maxium Y values of the series.
Min | Minimum value will be stored in this parameter | |
Max | Maximum value will be stored in this parameter |
Implements CChartSerie.
bool CChartSerieBase< T >::GetSerieYScreenMinMax | ( | double & | Min, | |
double & | Max | |||
) | const [inline, virtual] |
Retrieves the minimum and maxium screen Y values of the series.
Min | Minimum value will be stored in this parameter | |
Max | Maximum value will be stored in this parameter |
Implements CChartSerie.
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.
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 |
Implements CChartSerie.
void CChartSerieBase< T >::RegisterMouseListener | ( | CChartSeriesMouseListener< T > * | pListener | ) | [inline] |
Register a series mouse listener on this series.
pListener | The listener to register |
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.
pPoints | Array of the new points | |
Count | Size of the array |
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.