BCGControlBar Pro for MFC
CBCGPChartAxisMarkObject* CBCGPChartVisualObject::AddChartAxisMarkObject ( double  dblVal,
const CString &  strText,
BOOL  bVertAxis = TRUE,
BOOL  bOutside = TRUE,
const CBCGPBrush brTextColor = CBCGPBrush(),
const CBCGPBrush brFill = CBCGPBrush(),
const CBCGPBrush brOutline = CBCGPBrush() 
)

Adds an axis mark Chart Object to the Chart.

Returns
A pointer to the newly created Chart Object.

Call this helper to add a new axis mark object. See CBCGPChartAxisMarkObject for more information about axis marks.

The helper does not provide the ability to shift the axis mark object by a couple of pixels relative to axis position, but you can modify the coordinates of the base object to do so.

The following example shifts the axis mark by 10 pixels from the Y axis:

Copy
CBCGPChartAxisMarkObject* pMarkLine = pChart->AddChartAxisMarkObject(5.0, _T("5.0"), TRUE, TRUE, CBCGPBrush(), m_brAxisMarkFill);
// get the current coordinates and modify them
CBCGPRect rcCoordinates = pMarkLine->GetCoordinates();
rcCoordinates.bottom = 10;
// set the coordinates back to the object preserving coordinate mode
pMarkLine->SetCoordinates(rcCoordinates, pMarkLine->GetCoordinateMode());
Parameters
dblValSpecifies X or Y axis value to place the mark at.
strTextSpecifies axis mark text.
bVertAxisTRUE - place the mark at vertical axis. FALSE - place the mark at horizontal axis.
bOutsideTRUE - place outside axis mark; FALSE - place inside axis mark.
brTextColorSpecifies object's text color.
brFillSpecifies mark background.
brOutlineSpecifies line color.