BCGControlBar Pro for MFC
void CBCGPChartLegendVisualObject::UpdateLegendColors ( BOOL  bForceUpdate = FALSE,
CBCGPChartVisualObject pChartOrg = FALSE 
)

Updates legend colors

This method is called automatically when a color theme of the first related chart has been changed. If you set custom related chart properties directly, call this method with bForce = TRUE. If you want the legend using colors of another chart, pass a pointer to that chart in pChartOrg. The following legend colors are updated:

  • m_legendStyle.m_brParentControlFill - fills background of legend (used to fill background of parent control, if the legend is not in container). Takes chart background color.
  • m_legendStyle.m_brFill - fills interior of legend. Takes the color used for internal chart legend.
  • m_legendStyle.m_outlineFormat.m_brLineColor - color of legend grid lines. Takes the line color used for internal chart legend.
  • m_legendStyle.m_titleFormat.m_brTextColor - color of legend title. Takes color to draw chart title.
Parameters
bForceUpdateFALSE - legend colors won't be updated if they have already been set; otherwise the colors are taken from the first related chart or from pChartOrg
pChartOrga pointer to a chart to take the colors from. If it's NULL, the legend takes colors from the first related chart