BCGControlBar Pro for MFC
CBCGPChartLegendEntry

Detailed Description

The CBCGPChartLegendEntry class implements the functionality of legend row and manages a list of CBCGPChartLegendCell objects.

If you wish to add one or more custom cells displayed in one row, you have to override CBCGPChartLegendVisualObject::OnLegendContentCreated or process BCGM_ON_CHART_LEGEND_CONTENT_CREATED, create a legend entry, create custom cells with desired content, add cells to entry and finally add entry to legend.

The following example illustrates how to add an entry (legend row) with two custom cells at the top of the legend:

Copy
LRESULT CMyView::OnLegendContentCreated(WPARAM, LPARAM lp)
{
CBCGPChartLegendEntry* pEntryHead = new CBCGPChartLegendEntry(pLegend);
CBCGPChartLegendCell* pCell1 = new CBCGPChartLegendCell(_T("Head Item"));
CBCGPChartLegendCell* pCell2 = new CBCGPChartLegendCell(_T("Head Value"));
pEntryHead->AddLegendCell(pCell1);
pEntryHead->AddLegendCell(pCell2);
pLegend->InsertLegendEntry(pEntryHead, 0);
return 0;
}

Inherits CObject.

Public Member Functions

 CBCGPChartLegendEntryThe constructor
 
 AddLegendCellAdds a legend cell to legend entry
 
 AdjustLayoutCalled to adjust layout of encapsulated cells
 
 CalcSizeCalled to calculate entry size
 
 ContainsCellTells whether an entry contains a cell that displays a legend of specified series and data point
 
 GetCellReturns a cell located at specified index
 
 GetCellCountReturns a number of underlined cells
 
 GetCellWidthReturns width of cell located at specified index
 
 GetLegendCellFromPointReturns a cell containing specified point in client coordinates
 
 GetOffsetReturns offset of entry from left-top corner of legend
 
 GetParentLegendReturns a pointer to a parent legend
 
 GetSizeReturns entry size
 
 IsCustomTells whether an entry contains at least one cell with type LCT_CUSTOM
 
 OnDrawCalled to draw an entry
 
 OnDrawGridLinesCalled to draw grid lines around cells
 
 SetOffsetSets offset of entry from the top-left corner of legend.