BCGControlBar Pro for MFC
CBCGPChartSurfaceSeries

Detailed Description

The CBCGPChartSurfaceSeries class implements the functionality of surface series, which enables visualization of 3D surface data.

You can either create a CBCGPChartLineSeries object directly and then call CBCGPChartVisualObject::AddSeries, or call CBCGPChartVisualObject::CreateSeries to create the series indirectly.

Also you can call CBCGPChartVisualObject::SetChartType(BCGPChartSurface3D) to make the surface series created automatically once you begin adding data with CBCGPChartVisualObject::AddChartData.

The series expects ordered data and it automatically calculates surface dimensions (when it sees an X value smaller than the previous, it automatically sets X dimension and then calculates the grid size according to the total number of data points divided by the X dim). However, if the data is not ordered by X, you can call CBCGPChartSurfaceSeries::SetSurfaceDimension and specify the desired X dimension.

The most convinient way to add data is calling CBCGPChartVisualObject::AddChartDataYXZ(y, x, z); where z is an outer loop:

Copy
for (double z = zMin; z < zXax; z += zStep)
{
for (double x = xMin; x < xMax; x += xStep)
{
double y = f(x,z);
pChart->AddChartData(y, x, z, nSeries);
}
}

It's highly recommended using OpenGL renderer for large surfaces. Also it works more correctly for intersecting surfaces. You can set the hardware rendering engine by calling CBCGPChartDiagram3D::SetRenderingType:

Copy
pChart->GetDiagram3D()->SetRenderingType(CBCGPEngine3D::BCGP_RT_OPENGL, FALSE);

Currently the library implements two types of surfaces: "standard" and "levels". In case of the "standard" surface each grid cell is assigned a color according to a level color corresponding to the value of left bottom point. For the "level" surface each cell is intersected with horizontal planes (where the plane Y value corresponds to a level) and polygons, which were created by intersection of grid cell with the planes, are painted with appropriate level colors.

The following options can be applied to a surface chart:

You can study CBCGPChartExample for more details.

+ Inheritance diagram for CBCGPChartSurfaceSeries:

Public Member Functions

 CBCGPChartSurfaceSeriesConstructs a CBCGPChartSurfaceSeries object.
 
 CBCGPChartSurfaceSeriesConstructs a CBCGPChartSurfaceSeries object.
 
 AddDataPointAdds a new data point to the series.
 
 AddDataPointAdds a new data point to the series.
 
 AddDataPointAdds a new data point to the series.
 
 EnableFrameTransparencySets frame transparency option.
 
 EnableLevelRangeInLegendLabelDefines how level values are displayed in the chart legend.
 
 GetColorMapCountReturns current color map count (level count).
 
 GetColorModeReturns current color mode.
 
 GetFlatLevelReturns current value of the "flat" level.
 
 GetFrameColorReturns current frame color.
 
 GetFrameStyleReturns current frame style.
 
 GetLevelRangeReturns current custom level range.
 
 GetSurfaceDimensionReturns current surface dimension.
 
 GetSurfaceOpacityReturns the surface opacity.
 
 GetSurfaceTrianglesFor internal use.
 
 GetSurfaceTypeReturns the current surface type.
 
 IsContinuousLegendKeyTells whether the series legend keys indicating surface levels are drawn continuously, or separately.
 
 IsDrawFlatTells whether a surface is drawn as a flat color map.
 
 IsFrameTransparencyEnabledTells whether the frame is drawn with the same opacity level as the surface.
 
 IsLevelRangeInLegendLabelEnabledTells whether legend items display minimum and maximum level range values, or only minimum level values.
 
 IsWireFrameTells whether the surface is drawn as a wireframe.
 
 OnCalcScreenPointsCalled to calculate screen positions of surface elements.
 
 SetColorMapCountSets number of colors in the color map (the same as number of levels).
 
 SetColorModeSets color mode.
 
 SetContinuousLegendKeySets the option to draw the series legend keys indicating surface levels continuously.
 
 SetDrawFlatSets "draw flat" option.
 
 SetFrameColorSets custom frame color.
 
 SetFrameStyleSets new frame style.
 
 SetHitTestToleranceSets hit test tolerance.
 
 SetLevelRangeModeSets level range mode.
 
 SetSurfaceDimensionSets surface dimension.
 
 SetSurfaceOpacitySets surface opacity.
 
 SetSurfaceTypeSets surface type.
 
 SetWireFrameSets an option to display a surface as a wireframe,
 
 UpdateSeriesColorsCalled when surface colors should be updated.
 
- Public Member Functions inherited from CBCGPChartSeries
 AddDataPointAdds a new data point to a series.
 
 AddDataPointAdds a new data point to a series.
 
 AddDataPointAdds a new data point to a series.
 
 AddDataPointsAdds batch of data points.
 
 AddEmptyDataPointAdds empty data point.
 
 AddEmptyDataPointAdds empty data point.
 
 AddEmptyDataPointAdds empty data point.
 
 CanBeConvertedToCategoryTells whether a series can be converted to the specified category.
 
 CanIncludeDataPointToLegendTells whether a data point can be displayed in a legend.
 
 ClearMinMaxValuesClears minimum and maximum series values.
 
 CopyDataPointsCopies all data points to a destination array.
 
 CopyFromSets a series from a source series.
 
 CreateErrorBarsAdds error bars to the series.
 
 EnableAutoColorDataPointsEnables automatic coloring of data points.
 
 EnableHistoryModeEnables "history" mode for any series.
 
 EnableUpdateAxesOnNewDataEnables or disables update of X axis when a new data point has been added.
 
 FindDataPointIndexFinds index of data point.
 
 GetAxesBoundingRectReturns a rectangle formed by axes a series is shown on.
 
 GetChartCategoryReturns series category.
 
 GetChartCtrlReturns a pointer to related chart visual objects.
 
 GetChartImplReturns a pointer to a current chart implementation.
 
 GetChartTypeReturns current series type (simple, stacked, full stacked, range).
 
 GetColorIndexReturns series color index.
 
 GetCurveTypeReturns a curve type used to draw series lines.
 
 GetDataBufferGets a pointer to array of double values, which can be used to store additional series values.
 
 GetDataPointAtReturns a pointer to a data point located at the specified index.
 
 GetDataPointCategoryNameReturns category name of a data point.
 
 GetDataPointColorIndexReturns a color index for the specified data point.
 
 GetDataPointCountReturns a number of data points in a series.
 
 GetDataPointFormatReturns data point formatting options.
 
 GetDataPointLabelTextReturns a data point's label text.
 
 GetDataPointScreenPointReturns a screen point associated with a data point.
 
 GetDataPointScreenPointCountReturns the number of screen points associated with a data point.
 
 GetDataPointShape3DReturns a pointer to 3D shape object representing a data point on 3D diagram.
 
 GetDataPointValueReturns a data point value at the specified component index.
 
 GetFormulaReturns a formula used to generate series data points.
 
 GetGroupIDReturns series group ID.
 
 GetHistoryDepthReturns history depth for a series in "history" mode.
 
 GetLongDataOffsetGets offset of long data.
 
 GetLongDataXGives access to array of X values used for optimized mode.
 
 GetLongDataYGives access to array of Y values used for optimized mode.
 
 GetLongDataY1Gives access to array of Y1 values used for optimized mode.
 
 GetMaxValueReturns maximum series value for the specified component.
 
 GetMinValueReturns minimum series value for the specified component.
 
 GetSeriesFormatReturns series format.
 
 HasErrorBarsTells whether a chart series has error bars.
 
 IsBackgroundOrderTells whether a series has background order.
 
 IsHistoryModeTells whether a series works in history mode.
 
 IsOptimizedLongDataModeTells whether a series works in "optimized long data" mode.
 
 IsUpdateAxesOnNewDataEnabledTells whether related axes are updated when a new data point is added.
 
 IsVirtualModeTells whether a series works in virtual mode.
 
 RecalcMinMaxValuesRecalculates minimum and maximum series values.
 
 RecreateErrorBarsRecreate existing error bars.
 
 RemoveDataPointsRemoves data points.
 
 RemoveErrorBarsRemoves all previously created error bars.
 
 SetChartImplSets a chart implementation.
 
 SetChartTypeSets new series category and type.
 
 SetCurveTypeSets curve type.
 
 SetDataLabelAngleSets angle of data point's data label.
 
 SetDataLabelContentSets data label content.
 
 SetDataLabelContentPaddingSets data label content padding.
 
 SetDataLabelDataFormatSets data label data format.
 
 SetDataLabelDisplayKeyTells the data label display legend key.
 
 SetDataLabelDistanceFromMarkerSets distance between data label and data marker.
 
 SetDataLabelDrawBorderSets "draw border" option for the data labels.
 
 SetDataLabelDropLineToMarkerSets option to connect data label and data marker by line (draw callout).
 
 SetDataLabelFillSets data label background color.
 
 SetDataLabelFormatSets data label format.
 
 SetDataLabelLineColorSets data label line color (color of border and callout line).
 
 SetDataLabelLineWidthSets data label line width (width of border and callout).
 
 SetDataLabelOptionsSets data label formatting options.
 
 SetDataLabelPositionSets data label position.
 
 SetDataLabelSeparatorSets a separator string (a string that separates data label values).
 
 SetDataLabelStrokeStyleSets data label stroke style (style of border and callout).
 
 SetDataLabelTextFormatSets data label text format.
 
 SetDataLabelUnderlineSets data label underline option. Not compatible with "draw border".
 
 SetDataPoint3DLineThicknessSets thickness of lines on 3D line chart.
 
 SetDataPointCategoryNameSets data point category name.
 
 SetDataPointColorIndexSets data point color index.
 
 SetDataPointLabelRectCalled to store bounding rectangle of data label.
 
 SetDataPointScreenPointCalled to store screen position of data point.
 
 SetDataPointValueSets a new value for the specified data point at specified component index.
 
 SetDefaultFillGradientTypeSets default fill gradient type.
 
 SetFormulaCall this method to set a formula generating data points for the series.
 
 SetGroupIDSets series group ID.
 
 SetIgnoreNegativeValuesSets an option to ignore negative values.
 
 SetLegendLabelContentSpecifies the content to be displayed in the legend.
 
 SetLegendLabelFillColorSets legend label fill color.
 
 SetLegendLabelFormatSets legend label data format.
 
 SetLegendLabelTextColorSets text color of a legend label.
 
 SetLegendLabelTextFormatSets text format of a legend label.
 
 SetLongDataOffsetSets long data offset.
 
 SetMarkerFillSets marker fill brush for all data points, or for specified data point.
 
 SetMarkerFormatSets marker format for all data points, or for individual data point.
 
 SetMarkerLineColorSets marker line color for all data points, or for individual data point.
 
 SetMarkerLineWidthSets marker line width for all data points, or for specified data point.
 
 SetMarkerOptionsSets marker options for all markers, or for specified data point.
 
 SetMarkerShapeSets marker shape either for all data points in a series, or for specified data point.
 
 SetMarkerSizeSets marker size either for all markers in a series, or for specified data point.
 
 SetMarkerStrokeStyleSets stroke style either for all series marker lines, or for specified data point.
 
 SetMaxValueSets maximum component value.
 
 SetMinMaxValuesSets a new minimum or maximum value.
 
 SetMinValueSets minimum component value.
 
 SetRelatedAxesDisplay a series on the specified axes.
 
 SetRelatedAxisDisplay a series on the specified axis.
 
 SetSeriesElementFormatSets formatting options for a data point.
 
 SetSeriesFillSets fill brush for all series elements, or for specified data point.
 
 SetSeriesFormatSets series format.
 
 SetSeriesLineColorSets color either for all series lines, or for specified data point.
 
 SetSeriesLineDashStyleSets dash style either for all series lines, or for specified data point.
 
 SetSeriesLineWidthSets line width either for all series lines, or for specified data point.
 
 SetSeriesStrokeStyleSets stroke style either for all series lines, or for specified data point.
 
 SetTreatNullsDefines series behavior when it encounters empty data.
 
 SetUseWordWrapForDataLabelsSets an option to use word wrapping for long data labels.
 
 SetVirtualModeEnables virtual mode for a series.
 
 ShowDataLabelShows or hides a data label for a data point, or for all data points in a series.
 
 ShowMarkerShows or hides a data marker for a specific data point, or for a whole series.
 
 ShowOnPrimaryAxisShows a series on primary or secondary axes.
 
 UpdateAxesUsed in conjunction with "EnableHistoryMode" and updates axes when a new data point has been added.
 
- Public Member Functions inherited from CBCGPVisualDataObject
 CBCGPVisualDataObjectDefault constructor.
 
 CBCGPVisualDataObjectCopy constructor.
 
 CreateCopyCreates the copy.
 
 GetParentVisualGets the parent visual object.
 
 GetValueGets the value.
 
 SetValueSets a value.
 
- Public Member Functions inherited from CBCGPAnimationManager
 CBCGPAnimationManagerDefault constructor.
 
 GetAnimatedValueGets current animated value.
 
 GetAnimationDurationGets animation duration.
 
 GetLastAnimationErrorGets the animation error returned by recent call to Windows Animation API.
 
 IsAnimatedChecks if animation is running.
 
 StartAnimationStarts an animation.
 
 StartFlashAnimationStarts "flash" animation.
 
 StopAnimationStops an animation.
 

Public Attributes

 m_arCustomSurfaceColorsContains custom surface colors.
 
 m_strLegendLevelValueFormatSpecifies format of surface level values displayed in the legend.
 
- Public Attributes inherited from CBCGPChartSeries
 m_bIncludeDataPointLabelsToLegendSpecifies whether data point labels should be included in the legend.
 
 m_bIncludeSeriesToLegendSpecifies whether include a series key and name to the legend.
 
 m_bVisibleShows or hides a series.
 
 m_nLegendKeyToLabelDistanceSpecifies distance between legend key and data label text.
 
 m_strDefaultTooltipNameSpecifies series name for tooltip.
 
 m_strSeriesNameSpecifies series name.
 

Additional Inherited Members

- Public Types inherited from CBCGPAnimationManager
enum  BCGPAnimationType
 
- Static Public Member Functions inherited from CBCGPAnimationManager
 IsAnimationSupportedByOSChecks if animation is supported by OS.
 
- Protected Member Functions inherited from CBCGPChartSeries
 DoMouseRotateCalled by the framework when user rotates the chart using mouse/gesture.
 
- Protected Member Functions inherited from CBCGPAnimationManager
 OnAnimationIdleCalled by the framework in an animation idle time.