#include <ChartSerie.h>
Public Member Functions | |
virtual unsigned | GetPointsCount () const =0 |
Returns the number of points in the series. | |
virtual CPoint | GetPointScreenCoord (unsigned uPointIndex)=0 |
Returns the screen coordinate of a specific point. | |
virtual bool | GetSerieYMinMax (double &Min, double &Max) const =0 |
Retrieves the minimum and maxium Y values of the series. | |
virtual bool | GetSerieXMinMax (double &Min, double &Max) const =0 |
Retrieves the minimum and maxium X values of the series. | |
virtual bool | GetSerieXScreenMinMax (double &Min, double &Max) const =0 |
Retrieves the minimum and maxium screen X values of the series. | |
virtual bool | GetSerieYScreenMinMax (double &Min, double &Max) const =0 |
Retrieves the minimum and maxium screen Y values of the series. | |
void | SetName (const TChartString &NewName) |
Sets the name of the series, which is displayed in the legend. | |
TChartString | GetName () const |
Returns the name of the series. | |
void | ValueToScreen (double XValue, double YValue, CPoint &ScreenPoint) const |
Converts any data point into its relative screen point. | |
double | YScreenToValue (long YScreenCoord) const |
Converts an Y screen value into its relative Y data value. | |
double | XScreenToValue (long XScreenCoord) const |
Converts an Xscreen value into its relative X data value. | |
CChartSerie (CChartCtrl *pParent) | |
Constructor. | |
virtual | ~CChartSerie () |
Destructor. | |
void | SetVisible (bool bVisible) |
Specifies if the series is visible or not. | |
bool | IsVisible () const |
Returns true if the series is visible. | |
COLORREF | GetColor () const |
Returns the color of the series. | |
void | SetColor (COLORREF NewColor) |
Sets the color of the series. | |
COLORREF | GetShadowColor () const |
Returns the color of the shadow. | |
void | SetShadowColor (COLORREF NewColor) |
Sets the color of the shadow. | |
void | EnableShadow (bool bEnable) |
Enables or disables the shadow for the series. | |
void | SetShadowDepth (int Depth) |
Sepcifies the depth (in pixels) of the shadow. | |
virtual bool | IsPointOnSerie (const CPoint &screenPoint, unsigned &uIndex) const =0 |
Tests if a certain screen point is on the series. | |
unsigned | GetSerieId () const |
Returns the series Id. | |
void | EnableMouseNotifications (bool bClickEnabled, bool bMoveEnabled) |
Enables or disables certain mouse notifications on the series. | |
Protected Member Functions | |
void | RefreshAutoAxes () |
Refreshes the automatic axes associated with this series. | |
virtual bool | GetVisiblePoints (unsigned &uFirst, unsigned &uLast) const =0 |
Returns the first and last visible points of the series. | |
virtual void | DrawLegend (CDC *pDC, const CRect &rectBitmap) const =0 |
Draws the legend icon for the series. | |
virtual void | Draw (CDC *pDC)=0 |
Draws the most recent points of the series. | |
virtual void | DrawAll (CDC *pDC)=0 |
Redraws the full series. | |
virtual void | DrawLabels (CDC *pDC)=0 |
Draws the labels of the series. | |
virtual bool | OnMouseEvent (CChartMouseListener::MouseEvent mouseEvent, const CPoint &screenPoint)=0 |
Called when a mouse event is detected on the chart. | |
bool | NotifyMouseMoveEnabled () |
Returns true if the series reacts on mouse moves. | |
bool | NotifyMouseClickEnabled () |
Returns true if the series reacts on mouse clicks. | |
Protected Attributes | |
CChartCtrl * | m_pParentCtrl |
The parent charting control. | |
CChartAxis * | m_pVerticalAxis |
The related vertical axis. | |
CChartAxis * | m_pHorizontalAxis |
The related horizontal axis. | |
TChartString | m_strSerieName |
The series name displayed in the legend. | |
bool | m_bIsVisible |
Specifies if the series is visible. | |
bool | m_bShadow |
Specifies if the series has shadow enabled. | |
COLORREF | m_SerieColor |
Color of the series. | |
COLORREF | m_ShadowColor |
Color of the shadow. | |
int | m_iShadowDepth |
Depth (in pixels) of the shadow. | |
CRect | m_PlottingRect |
The rectangle in which the series should be drawn. |
The class doesn't manipulate points (the type of point is unknown at this level in the class hierarchy) but it provides all other functionalities which are independant of the point type.
The drawing of the series is made through pure virtual functions which should be implemented by derived classes.
Each series is identified by an Id.
virtual void CChartSerie::Draw | ( | CDC * | pDC | ) | [protected, pure virtual] |
Draws the most recent points of the series.
This pure virtual function should be overriden by child classes. This function should only draw the points that were not previously drawn.
pDC | The device context used to draw |
Implemented in CChartCandlestickSerie, and CChartGanttSerie.
virtual void CChartSerie::DrawAll | ( | CDC * | pDC | ) | [protected, pure virtual] |
Redraws the full series.
This pure virtual function should be overriden by child classes.
pDC | The device context used to draw |
Implemented in CChartCandlestickSerie, and CChartGanttSerie.
virtual void CChartSerie::DrawLabels | ( | CDC * | pDC | ) | [protected, pure virtual] |
Draws the labels of the series.
This pure virtual function should be overriden by child classes.
pDC | The device context used to draw |
virtual void CChartSerie::DrawLegend | ( | CDC * | pDC, | |
const CRect & | rectBitmap | |||
) | const [protected, pure virtual] |
Draws the legend icon for the series.
This pure virtual function should be overriden by child classes.
pDC | The device context used to draw | |
rectBitmap | The rectangle in which to draw the legend icon |
Implemented in CChartCandlestickSerie, and CChartGanttSerie.
void CChartSerie::EnableMouseNotifications | ( | bool | bClickEnabled, | |
bool | bMoveEnabled | |||
) |
Enables or disables certain mouse notifications on the series.
Checking if a point is on the series could degrade performances if it has to be done for each mouse event. This function allows to disable certain notifications, in which case the test won't be done. By default the series reacts on mouse clicks but not on mouse moves.
bClickEnabled | Specifies if the series reacts on mouse clicks. | |
bMoveEnabled | Specifies if the series reacts on mouse moves. |
virtual bool CChartSerie::GetSerieXMinMax | ( | double & | Min, | |
double & | Max | |||
) | const [pure 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 |
Implemented in CChartSerieBase< T >, CChartSerieBase< SChartCandlestickPoint >, CChartSerieBase< SChartXYPoint >, CChartSerieBase< SChartGanttPoint >, and CChartSerieBase< PointType >.
virtual bool CChartSerie::GetSerieXScreenMinMax | ( | double & | Min, | |
double & | Max | |||
) | const [pure 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 |
Implemented in CChartSerieBase< T >, CChartSerieBase< SChartCandlestickPoint >, CChartSerieBase< SChartXYPoint >, CChartSerieBase< SChartGanttPoint >, and CChartSerieBase< PointType >.
virtual bool CChartSerie::GetSerieYMinMax | ( | double & | Min, | |
double & | Max | |||
) | const [pure 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 |
Implemented in CChartSerieBase< T >, CChartSerieBase< SChartCandlestickPoint >, CChartSerieBase< SChartXYPoint >, CChartSerieBase< SChartGanttPoint >, and CChartSerieBase< PointType >.
virtual bool CChartSerie::GetSerieYScreenMinMax | ( | double & | Min, | |
double & | Max | |||
) | const [pure 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 |
Implemented in CChartSerieBase< T >, CChartSerieBase< SChartCandlestickPoint >, CChartSerieBase< SChartXYPoint >, CChartSerieBase< SChartGanttPoint >, and CChartSerieBase< PointType >.
virtual bool CChartSerie::GetVisiblePoints | ( | unsigned & | uFirst, | |
unsigned & | uLast | |||
) | const [protected, pure 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 |
Implemented in CChartSerieBase< T >, CChartSerieBase< SChartCandlestickPoint >, CChartSerieBase< SChartXYPoint >, CChartSerieBase< SChartGanttPoint >, and CChartSerieBase< PointType >.
virtual bool CChartSerie::IsPointOnSerie | ( | const CPoint & | screenPoint, | |
unsigned & | uIndex | |||
) | const [pure virtual] |
Tests if a certain screen point is on the series.
This function should be overidden by all child classes.
screenPoint | The screen point to test | |
uIndex | If the point is close to a specific point of the series, its index is stored here. |
Implemented in CChartBarSerie, CChartCandlestickSerie, CChartGanttSerie, CChartLineSerie, CChartPointsSerie, and CChartSurfaceSerie.
virtual bool CChartSerie::OnMouseEvent | ( | CChartMouseListener::MouseEvent | mouseEvent, | |
const CPoint & | screenPoint | |||
) | [protected, pure virtual] |
Called when a mouse event is detected on the chart.
This pure virtual function should be overriden by child classes.
mouseEvent | The event that occured on the control | |
screenPoint | The screen point on which the event occured |
Implemented in CChartSerieBase< T >, CChartSerieBase< SChartCandlestickPoint >, CChartSerieBase< SChartXYPoint >, CChartSerieBase< SChartGanttPoint >, and CChartSerieBase< PointType >.
void CChartSerie::SetVisible | ( | bool | bVisible | ) |
Specifies if the series is visible or not.
An invisible series won't affect automatic axis: it is considered as if it was not in the control.
void CChartSerie::ValueToScreen | ( | double | XValue, | |
double | YValue, | |||
CPoint & | ScreenPoint | |||
) | const |
Converts any data point into its relative screen point.
XValue | The X value of the data point | |
YValue | The Y value of the data point | |
ScreenPoint | The screen point will be stored in the parameter |