BCGControlBar Pro for MFC
CBCGPChartLegendCtrl* CBCGPChartView::EnableAdvancedLegend ( BOOL  bEnable = TRUE,
BCGPChartLayout::LegendPosition  position = BCGPChartLayout::LP_RIGHT,
BOOL  bIsVerticalLayout = TRUE,
CBCGPChartLegendVisualObject::LegendAlignment  horzAlign = CBCGPChartLegendVisualObject::LA_CENTER,
CBCGPChartLegendVisualObject::LegendAlignment  vertAlign = CBCGPChartLegendVisualObject::LA_CENTER,
CRuntimeClass *  pLegendRTC = NULL,
BOOL  bPrint = FALSE 

Displays an advanced legend that is automatically connected to hosted chart

Call this method to display an advanced legend within chart view. It's implemented as a separate control that is automatically connected to chart and repositioned by view according to "position", "horzAlign" and "vertAlign" parameters.

position can be one of the following enumerated values:

  • LP_TOP - legend is displayed above chart
  • LP_BOTTOM - legend is displayed under chart
  • LP_LEFT - legend is displayed from the left side of chart
  • LP_RIGHT - legend is displayed from the right side of chart
  • LP_TOPRIGHT - legend is displayed from the top-right side of chart.

horzAlign and vertAlign can be one of the following values:

  • LA_NEAR - legend at the top/left
  • LA_CENTER - legend is centered
  • LA_FAR - legend at the bottom/right
bEnableshows or hides advanced legend
positionspecifies legend position relative to chart
bIsVerticalLayoutspecifies whether the legend has vertical or horizontal layout
horzAlignspecifies horizontal alignment of legend
vertAlignspecifies vertical alignment of legend
pLegendRTCa pointer to a runtime class information of custom legend
bPrintspecifies whether advanced legend should be printed