#include <ChartBarSerie.h>
Public Member Functions | |
CChartBarSerie (CChartCtrl *pParent) | |
Constructor. | |
~CChartBarSerie () | |
Destructor. | |
void | SetHorizontal (bool bHorizontal) |
Specifies if the bars are vertical or horizontal. | |
bool | GetHorizontal () const |
Returns true if bars are horizontal, false otherwise. | |
void | SetBorderColor (COLORREF BorderColor) |
Sets the bars border color. | |
COLORREF | GetBorderColor () const |
Returns the bars border color. | |
void | SetBorderWidth (int Width) |
Sets the bars border width. | |
int | GetBorderWidth () const |
Returns the bars border width. | |
void | SetBarWidth (int Width) |
Sets the bars width (in pixels). | |
int | GetBarWidth () const |
Returns the bars width (in pixels). | |
void | SetGroupId (unsigned GroupId) |
Set the group Id of the series. | |
unsigned | GetGroupId () const |
Returns the group Id of the series. | |
void | SetStacked (bool bStacked) |
Specifies if the series is stacked with other bar series. | |
bool | IsStacked () |
Returns true if the series is stacked. | |
void | ShowGradient (bool bShow) |
Specifies if a gradient is applied to the bars. | |
void | SetGradient (COLORREF GradientColor, EGradientType GradientType) |
Sets the gradient style. | |
void | SetBaseLine (bool bAutomatic, double dBaseLine) |
Specifies a base line for the bars. | |
bool | IsPointOnSerie (const CPoint &screenPoint, unsigned &uIndex) const |
Check whether a screen point is on the series. | |
Static Public Member Functions | |
static void | SetInterSpace (int Space) |
Static function used to specify the space (in pixels) between series of the same group. | |
static int | GetInterSpace () |
Static function returning the space between series of the same group. |
This class is a specialized series class used to display vertical (default) or horizontal bars. Each bar in the series is centered around its X value (for vertical bars) or Y value (for horizontal bars). Bars can be grouped together, so that they do not overlap but are stacked next to each other (or on top of each other). This is done by specifying a group Id: bar series with the same group Id will be grouped together (stacked). Series with different group Id will be independant (they will be drawn as if they were the only one, meaning that the different series will probably overlap).
bool CChartBarSerie::IsPointOnSerie | ( | const CPoint & | screenPoint, | |
unsigned & | uIndex | |||
) | const [virtual] |
Check whether a screen point is on the series.
This function returns true if the screen point is on one of the bars of the series. In that case, the index of the point is stored in the uIndex parameter.
screenPoint | The screen point to test | |
uIndex | If the point is close to a specific point of the series, its index is stored here. |
Implements CChartSerie.
void CChartBarSerie::SetBaseLine | ( | bool | bAutomatic, | |
double | dBaseLine | |||
) | [inline] |
Specifies a base line for the bars.
If a baseline is specified, the bars will be drawn between that value and the point value, instead of being drawn between the axis ans the point value.
bAutomatic | If true, the bars are drawn between the axis and the point value. | |
dBaseLine | The value of the baseline. This parameter is ignored if bAutomatic is true. |
void CChartBarSerie::SetGradient | ( | COLORREF | GradientColor, | |
EGradientType | GradientType | |||
) |
Sets the gradient style.
GradientColor | The second color used for the gradient (the first one being the original series color). | |
GradientType | The type of gradient used between the two colors (vertical, horizontal, ...) |
void CChartBarSerie::SetGroupId | ( | unsigned | GroupId | ) |
Set the group Id of the series.
The group Id allows to stack series next to each other (or on top of each other).
void CChartBarSerie::SetStacked | ( | bool | bStacked | ) |
Specifies if the series is stacked with other bar series.
All bar series with the same group Id and with the stacked flag to true will be drawn on top of each other (for vertical bars).