BCGControlBar Pro for MFC
CBCGPChartSeries* CBCGPChartVisualObject::CreateSeries ( const CString &  strName,
const CBCGPColor color = CBCGPColor(),
BCGPChartType  type = BCGP_CT_DEFAULT,
BCGPChartCategory  category = BCGPChartDefault,
int  nSeriesIndex = -1 
)

Creates a series and adds it to the internal array of series.

Returns
A pointer to a newly created series if the function succeeds; otherwise NULL.

Call this method to create a series and automatically add it an internal array of series. If type and/or category are not specified (default), this method creates a series according to the default category and type that have been specified in SetChartType().

You can use this method if you need to display series of different categories on the same chart.

type can be one of the following enumerated values:

  • BCGP_CT_DEFAULT - use current chart type
  • BCGP_CT_SIMPLE - simple series
  • BCGP_CT_STACKED - stacked series
  • BCGP_CT_100STACKED - full stacked series
  • BCGP_CT_RANGE - range series

category can be one of the following enumerated values:

  • BCGPChartDefault - use default chart type
  • BCGPChartLine - line chart
  • BCGPChartPie - pie chart
  • BCGPChartPie3D - 3D pie chart
  • BCGPChartPyramid - pyramid chart
  • BCGPChartPyramid3D - 3D pyramid chart
  • BCGPChartFunnel - funnel chart
  • BCGPChartFunnel3D - 3D funnel chart
  • BCGPChartColumn - column chart
  • BCGPChartBar - bar chart
  • BCGPChartArea - area chart
  • BCGPChartStock - stock chart
  • BCGPChartBubble - bubble chart
  • BCGPChartLongData - large volume data chart
  • BCGPChartHistoricalLine - historical line chart
  • BCGPChartPolar - polar or radar chart
  • BCGPChartColumn3D - 3D column chart,
  • BCGPChartBar3D - 3D bar chart,
  • BCGPChartLine3D - 3D line chart,
  • BCGPChartArea3D - 3D area chart,
  • BCGPChartSurface3D - surface chart (3D)

nSeriesIndex allows to display series in desired order. For example:

Copy
CreateSeries("Area", CBCGPColor(), BCGP_CT_DEFAULT, BCGPChartArea3D, 2);
CreateSeries("Line", CBCGPColor(), BCGP_CT_DEFAULT, BCGPChartLine3D, 1);

will display the line series first. If nSeriesIndex is -1 the series will be displayed in the same order as they have been created; otherwise you should ensure that an existing series located at this index is properly destroyed or relocated.

Parameters
strNameSpecifies series name.
colorSpecifies default series line color. Set empty color to use colors from the current visual theme.
typeSpecifies series type.
categorySpecifies series category.
nSeriesIndexSpecifies series index.