BCGSuite for MFC
CBCGPChartTextObject

Detailed Description

The CBCGPChartTextObject implements the functionality of a textual Chart Object.

The following picture illustrates some text objects you can add:

  • a text object within a rounded rectangle with shadow
  • a text object with connector
  • a text within rectangle

The text box, font and all other parameters are fully customizable (use CBCGPChartObject::m_format to format a text object).

Call SetRoundedShape() to set rounded corners, SetShadow() to display a shadow under text box, SetDrawConnector() to drop a line with connector from the text box to a point on the diagram (you have to set CBCGPChartObject::CM_CHART_VALUE_DIST_ANGLE coordinate mode for this purpose).

You can use CBCGPChartVisualObject::AddChartTextObject to add a text object to a Chart.

The following shows another way to construct and add a text object:

Copy
CBCGPChartVisualObject* pChart = m_wndChart.GetChart();
// create a text object at coordinates X = 2; Y = 3; with distance from (X,Y) point 30 pixels, angle -45 degrees
m_pTextObjectGreen = new CBCGPChartTextObject(pChart, _T("Green Area"), 2, 3, m_brText1, m_brFillText1, m_brLine3, 30, -45, TRUE /*draw connector*/);
// add the object to parent Chart
pChart->AddChartObject(m_pTextObjectGreen);

You can also use the base CBCGPChartObject class and specify its m_strText property, but you won't be able to set rounded corners, display shadow and connector.

See also
CBCGPChartObject
+ Inheritance diagram for CBCGPChartTextObject:

Public Member Functions

 CBCGPChartTextObjectConstructs a Chart Text Object.
 
 GetCornerRadiusReturns the radius of corners used to draw rounded shape.
 
 GetShadowDepthReturns shadow depth.
 
 IsDrawConnectorTells whether to draw the connector, or not.
 
 SetDrawConnectorEnables connector between text box and a point on the diagram.
 
 SetRoundedShapeSets the rounded corners for the text box.
 
 SetShadowTells the text box to display a shadow.
 
- Public Member Functions inherited from CBCGPChartObject
 CBCGPChartObjectConstructs a CBCGPChartObject object.
 
 GetBoundingRectReturns a bounding rectangle of a Chart Object.
 
 GetCoordinateModeReturns current coordinate mode.
 
 GetCoordinatesReturns current coordinates of a Chart Object.
 
 GetDescriptionObtain a chart object's description.
 
 GetObjectSizeCall this method to retrieve custom Chart Object size.
 
 GetTooltipObtain a chart object's tooltip.
 
 HitTestHit tests an Chart Object.
 
 IsForegroundSpecifies whether a Chart Object is foreground, or background.
 
 IsObjectShownOnAxisTells whether an object is displayed on specified axis.
 
 IsVisibleTells whether a Chart Object is visible, or hidden.
 
 OnCalcScreenPointsCalled by the framework to calculate screen positions (in parent Chart client coordinates).
 
 OnDrawCalled by the framework when it needs to draw a Chart Object.
 
 SetAxisMarkCoordinateSets "axis mark" coordinate.
 
 SetCoordinateModeSets new coordinate mode.
 
 SetCoordinatesSets new coordinates.
 
 SetCoordinatesSets new coordinates.
 
 SetCoordinatesSets new coordinates.
 
 SetForegroundSets a Chart Object foreground or background.
 
 SetObjectSizeSets custom object size.
 
 SetParentChartSets the parent Chart.
 
 SetRelatedAxesSets related axes.
 
 SetTooltipSpecifies a chart object's tooltip.
 
 SetVisibleShows or hides a Chart Object.
 

Protected Member Functions

 OnDrawShapeDraws the text box shape.
 
- Protected Member Functions inherited from CBCGPChartObject
 OnCalcObjectSizeCalled by the framework to calculate a Chart Object size.
 
 OnDrawTextCalled to draw a Chart Object's text.
 

Additional Inherited Members

- Public Attributes inherited from CBCGPChartObject
 m_formatSpecifies a Chart Object formatting options.
 
 m_nObjectIDSpecifies a Chart Object ID.
 
 m_strTextSpecifies Chart Object's text.