Chapter 18:
Chart Layout Functions
 

AdjustToKeepChartOnScreen(); Adjust Frame to Keep Chart on Screen

 

AreVisualizeEffectUsed(); Are Visualize Effects Used?

 

CanUseEntireOrdAxis(); Can the chart use the entire ordinal axis to draw?

 

CreateRisers(); Create Risers

 

DetermineScale(); Determine Scale of the graph

 

EnablePlaceDefaultElements(); Routine to Disable/Enable PlaceDefaultElements Logic

 

GetAxisScaleMinMax(); Get the Minimum/Maximum Scaling for an Axis

 

GetGraphDocSize(); Get Graph Document Size

 

GetGraphOrientation(); Get Graph Orientation

 

GetGraphResolutionUnit(); Get Graph Resolution Units

 

GetGraphSubType(); Get Graph Sub-Type

 

GetGraphTypeIndex(); Get Graph Type Index

 

GetLegendLayoutInformation(); Get Legend Layout Information

 

GetSGCount(); Get Series/Group Count

 

GloSetMaxAutofitSize(); Global Set Maximum Autofit Size

 

GloSetMinAutofitSize(); Global Set Minimum Autofit Size

 

IsBipolar(); Is the graph a bi-polar chart?

 

IsDataText(); Is object data text?

 

IsDualYAxes(); Is the graph a Dual-Y axes chart?

 

IsO1AxisUsed(); Is the O1-Axis used in a chart?

 

IsXAxisUsed(); Is the X-Axis used in a chart?

 

IsY1AxisUsed(); Is the Y1-Axis used in a chart?

 

IsY2AxisUsed(); Is the Y2-Axis used in a chart?

 

IsY3AxisUsed(); Is the Y3-Axis used in a chart?

 

IsY4AxisUsed(); Is the Y4-Axis used in a chart?

 

PlaceDefaultElements(); Place Default Elements

 

RecalcLegend(); Recalculate Legends

 

SetGraphDocSize(); Set Graph Document Size

 

SetGraphResolutionUnit(); Set Graph Resolution Units

   

AdjustToKeepChartOnScreen()

 

This function shrinks and moves the chart frame so that it and all its labels are guaranteed to be entirely on-screen.

Syntax:

BOOLEAN16 PUBLIC
AdjustToKeepChartOnScreen(
     DrawEnvPtr pDE,
     GraphPtr pGraph
);

Input:

pDE: Pointer to a draw environment created by AllocDrawEnvPtr()

 

pGraph: Pointer to the graph object created by AllocGraphPtr()

Return:

BOOLEAN16; TRUE/FALSE

 

True =

The frame was adjusted

 

False =

No frame adjustment required

Notes:

This function should be called after any change to an Axis label!

AreVisualizeEffectUsed()

 

This function can be used to determine if one of the 3D graph visual effects (glow, suppression, or transparency) is used in a graph. The 3D visual effects are set by the A3D_GLOW_RISER, A3D_SUPPRESS_RISER, and A3D_TRANS_RISER attributes.:

Syntax:

BOOLEAN16 PUBLIC
AreVisualizeEffectUsed(
     GraphPtr pGraph,
     INT32 nState
);

Input:

pGraph: Pointer to an graph created by AllocGraphPtr()

 

nState; Visualize effect to test

 

1=

Transparency

 

2=

Suppression

 

4=

Glow

Return:

BOOLEAN16; TRUE/FALSE

 

TRUE=

nState visualize effect is used

 

FALSE=

nState visualize effect is not used in the graph

Also See:

A3D_GLOW_RISER, A3D_SUPPRESS_RISER, A3D_TRANS_RISER in the PGSDK Attributes Guide

   

CanUseEntireOrdAxis()

 

This function returns a BOOLEAN16 indicating whether the chart can use the entire ordinal axis to draw the risers.

Syntax:

BOOLEAN16 PUBLIC
CanUseEntireOrdAxis(
     GraphPtr G
);

Input:

G; Pointer to a graph object created by AllocGraphPtr()

Return:

BOOLEAN16; TRUE/FALSE

 

True =

if this chart can use the ENTIRE ordinal axis to draw the risers

 

False =

if this chart needs extra space on right/left to draw the risers

   

CreateRisers()

 

This function creates nCount risers in pGraph. This important function creates internal memory objects for attribute storage. It should be used when a developer wishes to set a riser attribute for a series that does not yet appear in the graph. It is recommended that this function be called with nCount set to 16 immediately after any call to Load_TIFFGraph(). This will guarantee that developers can set attributes for the first 16 series of riser information regardless of the number of risers that are visible in the chart.

Syntax:

INT16 PUBLIC
CreateRisers (
     GraphPtr pGraph,
     INT16 nCount
);

Input:

pGraph: Pointer to a graph object created by AllocGraphPtr()

 

nCount: Number of risers to create

Return:

INT16: Zero

Example:

SetGraphDataInfo(gpGraph, &graphData);
CreateRisers(gpGraph, 16);

Also See:

GetRiserBounds(), GetRiserDetNodeLimit(), GetRiserSurface(), SetRiserDetNodeLimit()

   

DetermineScale()

 

This is a utility routine that can be used to specify an fMin and fMax for your data set in a ScaleClass structure identified by pScale. The function returns the minimum and maximum values and the number of gridlines that will appear on the Y-Axis. See the ScaleClass structure in Appendix A for details. For example, if your application uses: fMin = 3.5 and fMax = 85, this function might return: Min = 0, Max = 100, nGridlines = 5.

Syntax:

INT16 PUBLIC
DetermineScale (
     ScalePtr pScale
);

Input:

pScale: Pointer to a ScaleClass structure. See Appendix A.

Return:

INT16: Zero = Success/Non-Zero = Error

Also See:

GetRawLimits()

EnablePlaceDefaultElements()

 

This function is a utility routine that can be used to disable/enable the PlaceDefaultElements() logic

Syntax:

BOOLEAN16 PUBLIC
EnablePlaceDefaultElements(
     BOOLEAN16 bEnable
);

Input:

bEnable: TRUE/FALSE.

 

TRUE=

Enable PlaceDefaultElements()

 

FALSE=

Disable PlaceDefaultElements()

Return:

INT16: TRUE/FALSE

 

TRUE=

PlaceDefaultElements() was enabled

 

FALSE=

PlaceDefaultElements() was disabled

Also See:

PlaceDefaultElements()

   

GetAxisScaleMinMax()

 

For any axis, this function returns the minimum and maximum that will be drawn on the scale. It also returns the number of gridlines that will be drawn.:

Syntax:

INT16 PUBLIC
GetAxisScaleMinMax (
     GraphPtr pGraph,
     DataAxisRef nAxisID,
     REAL64 *pfMin,
     REAL64 *pfMax,
     PINT16 pnGridlines
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

 

nAxisID; The axis to get minimum, maximum, and number of gridlines. One of the following values from the DataAxisRef enum:

 

DataAxisRef enum

Description

 

gdY1 (0) =

Y1-Axis

 

gdY2 (1) =

Y2-Axis

 

gdX1 (2) =

X-Axis

 

gdZ1 (3) =

Z-Axis

 

gdY3 (4) =

Y3-Axis

 

gdY4 (5) =

Y4-Axis

 

pfMin; Pointer to location to store minimum scaling value.

 

pfMax; Pointer to location to store maximum scaling value.

 

pnGridlines; Pointer to location to store number of gridlines.

Return:

INT16; System Error Code

   

GetGraphDocSize()

 

This function gets the chart document width and height in pixels. Use SetGraphDocSize() to set the chart document width and height. These functions are utility routines that let the user store a set of "physical" dimensions for a chart (example: 640 x 480 pixels, start at hDC position 13,34).

Syntax:

VOID PUBLIC
GetGraphDocSize (
     GraphPtr pGraph,
     REAL *pWidth,
     REAL *pHeight
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

 

pWidth: Location where GetGraphDocSize() can store the width

 

pHeight: Location where GetGraphDocSize() can store the height

Return:

None

Also See:

SetGraphDocSize()

   

GetGraphOrientation()

 

This function returns the orientation (VERTICAL or HORIZONTAL) of a graph.:

Syntax:

INT16 PUBLIC
GetGraphOrientation(
     GraphPtr pGraph
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

Return:

INT16; 0/1

 

0=

Horizontal orientation

 

1=

Vertical orientation

   

GetGraphResolutionUnit()

 

This function returns an INT16 identifying the resolution units of a graph.:

Syntax:

INT16 PUBLIC
GetGraphResolutionUnit(
     GraphPtr pGraph
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

Return:

INT16; 0...3

 

UNIT_INCHES (0) =

Inches

 

UNIT_CM (1) =

Centimeters

 

UNIT_PIXELS (2) =

Pixels

 

UNIT_HIMETRICS (3) =

1/100 of mm

Also See:

SetGraphResolutionUnit()

   

GetGraphSubType()

 

This function returns the graph sub-type set by A_GRAPH_PRESET.

Syntax:

INT16 PUBLIC
GetGraphSubType(
     GraphPtr pGraph
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

Return:

INT16; An integer value that identifies the graph sub-type. See the nMinorType member of the TDG_GraphPresetInfo data structure in Appendix A for possible values.

Also See:

A_GRAPH_PRESET the PGSDK Attributes Guide, TDG_GraphPresetInfo

   

GetGraphTypeIndex()

 

This function returns an INT16 value identifying the type of the graph pGraph.

Syntax:

INT16 PUBLIC
GetGraphTypeIndex (
     GraphPtr pGraph
);

Input:

pGraph: Pointer to graph created by AllocGraphPtr()

Return:

INT16: A value from the GraphType enum:

 

GraphType

Value

Description

 

G_3D_BarType

0=

3D Bar Chart

 

G_3D_ColAreaType

1=

3D Column Area Chart

 

G_3D_ColLineType

2=

3D Column Line Chart

 

G_3D_ColStepType

3=

3D Column Step Chart

 

G_3D_CubeType

4=

3D Cube Chart

 

G_3D_CutCornerType

5=

3D Cut Corner Chart

 

G_3D_DiamondType

6=

3D Floating Diamond Chart

 

G_3D_HoneycombType

7=

3D Surface Honeycomb chart

 

G_3D_ModelType

8=

3D Models

 

G_3D_OctagonType

9=

3D Octagon chart

 

G_3D_PyramidType

10=

3D Pyramid Chart

 

G_3D_RowAreaType

11=

3D Row Area Chart

 

G_3D_RowLineType

12=

3D Row Line Chart

 

G_3D_RowStepType

13=

3D Row Step Chart

 

G_3D_ScatterType

14=

3D Scatter Chart

 

G_3D_SquareType

15=

3D Square Chart

 

G_3D_SurfaceType

16=

3D Surface Chart

 

G_Area

17=

2D Vertical Area Chart

 

G_Bars

18=

2D Vertical Bar Chart

 

G_BoxPlot

19=

Box Plot Chart

 

G_BoxPlotTC

20=

Box Plot Table Chart

 

G_Bubble

21=

2D Vertical Bubble Chart

 

G_ContourPlot

22=

Contour Plot Chart

 

G_Gantt

23=

Gantt Chart

 

G_HArea

24=

2D Horizontal Area Chart

 

G_HBars

25=

2D Horizontal Bar Chart

 

G_HBoxPlot

26=

Horizontal Box Plot Chart

 

G_HBoxPlotTC

27=

Box Plot Table Chart

 

G_HBubble

28=

2D Horizontal Bubble Chart

 

G_HContourPlot

29=

Horizontal Contour Plot Chart

 

G_HHistogram

30=

2D Horizontal Histogram

 

G_HLines

31=

2D Horizontal Line Chart

 

G_HScatter

32=

2D Horizontal Scatter Chart

 

G_Hinge

33=

Hinge

 

G_Histogram

34=

2D Vertical Histogram Chart

 

G_Lines

35=

2D Vertical Line Chart

 

G_MultiPie

36=

Multiple Pie Chart

 

G_OHLClose

37=

Open/High/Low/Close Stock Chart

 

G_Pie

38=

Pie Chart

 

G_PieBar

39=

Pie Bar Chart

 

G_Polar

40=

Polar Coordinate Chart

 

G_Radar

41=

Radar Chart

 

G_Scatter

42=

2D Scatter Chart

 

G_SpecMapCell

43=

Spectral Map

 

G_TableChart

44=

Table Chart

 

G_TextChart

45=

Text Chart

 

G_URadarArea

46=

Radar Area Chart

 

G_VJapaneseStock

47=

Candle Stock Chart

 

G_VStemLeaf

48=

Stem Leaf Chart

 

G_WMultiBar

49=

Multi-Bar

 

G_WWaterFall

50=

Waterfall chart

 

G_WWaterFall_Horz

51=

Horizontal Waterfall chart

 

G_X3D_FacetedFloater

52=

3D Faceted Floater Chart

 

G_X3D_FacetedRiser

53=

3D Faceted Riser Chart

 

G_XBI1_BalanceScoreCard

54=

Balanced Score Card Chart (Reserved for Future Use)

 

G_XBI1_ProductPosition

55=

Product Positioning Chart (Reserved for Future Use)

 

G_XBI1_ResourceReturn

56=

Resource Return Chart (Reserved for Future Use)

 

G_XBI1_TimeSeries

57=

Time Series Chart (Reserved for Future Use)

 

G_XBI1_YYYY

58=

Multi-Y Chart

 

G_XBI2_CENTROID

59=

Centroid Chart (Reserved for Future Use)

 

G_XRadarAreaStacked

60=

Radar Stacked Area (Reserved for Future Use)

 

G_XY_3D_ColLine

61=

Ribbon chart with 2 numeric axes (Reserved for Future Use)

 

G_XY_3D_RowLine

62=

Ribbon chart with 2 numeric axes (Reserved for Future Use)

 

G_XYZ_3D_Surface

63=

Surface chart with 3 numeric axes (Reserved for Future Use)

 

G_XYZ_3D2_CONTOUR

64=

3D Contour chart (Reserved for Future Use)

Example:

INT16 nType;
nType = GetGraphTypeIndex (
     pInfo->gpGraph );

Also See:

A_GRAPH_PRESET in the PGSDK Attributes Guide,

   

GetLegendLayoutInformation()

 

This function provides all the needed information for creating a sizing/moving XOR outline for use by higher-level routines. On return, the calculated element width and height will be stored at pnElementWidth and pnElementHeight. The calculated Start Point of first legend element will be stored at pStartPoint. The legend border margins will be stored at pnLeftRightMargin and pnBottomMargin.:

Syntax:

BOOLEAN16 PUBLIC
GetLegendLayoutInformation(
     DrawEnvPtr pDE,
     GraphPtr G,
     BoxInstPtr pLegendBox,
     PINT16 pnElementWidth,
     PINT16 pnElementHeight,
     PINT16 pnLeftRightMargin,
     PINT16 pnBottomMargin,
     Point *pStartPoint
);

Input:

pDE: Pointer to a draw environment created by AllocDrawEnvPtr()

 

G: Pointer to graph created by AllocGraphPtr()

 

pLegendBox; Pointer to a BoxInstRec that defines the location of the legend area

 

pnElementWidth; Pointer to a place to store Width of Legend Element.

 

pnElementHeight; Pointer to a place to store Height of Legend Element

 

pnLeftRightMargin; Pointer to a place to store Legend Border margin left and right

 

pnBottomMargin; Pointer to a place to store Legend Border margin at bottom of chart.

 

pStartPoint; Pointer to a place to store start point of first legend element

Return:

BOOLEAN16; TRUE/FALSE

 

TRUE=

Success

 

FALSE=

pLegendBox was modified

   

GetSGCount()

 

This function sets the locations at pnSeries and pnGroups to the number of series and groups in the graph G, respectively. If the bAbsolute flag is set, this function will not count series that have been ignored by the A2D_IGNORE_SERIES attribute.

Syntax:

INT16 PUBLIC
GetSGCount (
     GraphPtr G,
     BOOLEAN16 bAbsolute,
     PINT16 pnSeries,
     PINT16 pnGroups
);

Input:

G: Pointer to a graph created by AllocGraphPtr()

 

bAbsolute: TRUE/FALSE

 

TRUE=

Don't count ignored series

 

FALSE=

Count ignored series

 

pnSeries: Place to store number of series

 

pnGroups: Place to store number of groups

Return:

INT16: E00_OK

   

GloSetMaxAutofitSize()

 

This function is used to set the maximum size that can be used for auto-fitting text objects.

Syntax:

void PUBLIC
GloSetMaxAutofitSize(
     INT16 nHighLimit
);

Input:

nHighLimit; Maximum allowable size that can be used to auto-fit text objects

Return:

void

Also See:

GloSetMinAutofitSize()

   

GloSetMinAutofitSize()

 

This function is used to set the minimum size that can be used for auto-fitting text objects.

Syntax:

void PUBLIC
GloSetMinAutofitSize(
     INT16 nLowLimit
);

Input:

nLowLimit; Minimum allowable size that can be used to auto-fit text objects

Return:

Void

Also See:

GloSetMaxAutofitSize()

   

IsBipolar()

 

This function returns a BOOLEAN16 indicating whether or not the currently select graph is a bi-polar chart.

Syntax:

BOOLEAN16 PUBLIC IsBipolar(GraphPtr pGraph);

Input:

pGraph: Pointer to a valid graph

Return:

BOOLEAN16; TRUE/FALSE

 

TRUE=

Current graph sub-type is a bi-polar chart

 

FALSE=

Not a bi-polar chart

Also See:

IsDualYAxes()

IsDataText()

 

This function tests the object code (nObjectID) returns a BOOLEAN16 indicating whether or not the object is a data label.

Syntax:

BOOLEAN16
IsDataText(
     INT16 nObjectID
);

Input:

nObjectID; An object ID.

Return:

BOOLEAN16; TRUE/FALSE

 

TRUE=

nObjectID is a data label object

 

FALSE=

nObjectID is not a data label object

Notes:

This function will return TRUE if nObjectID is one of the following: O2D_DATATEXT, O3D_DATALABEL, O2D_DATATEXT_STACK_TOTAL, OPI_LBL_VALUE, OPI_LBLRING, or OPI_LBLPIE.

   

IsDualYAxes()

 

This function returns a BOOLEAN16 indicating whether or not the currently select graph is a Dual-Y axes chart.

Syntax:

INT16 PUBLIC
IsDualYAxes (
     GraphPtr pGraph
);

Input:

pGraph: Pointer to a valid graph

Return:

INT16; TRUE/FALSE

 

TRUE=

Current graph sub-type is a Dual-Y axes chart

 

FALSE=

Not a Dual-Y axes chart

Also See:

IsBiPolar()

   

IsO1AxisUsed()

 

This function returns TRUE/FALSE identifying whether or not the O1 axis is used in a given chart.

Syntax:

BOOL PUBLIC
IsO1AxisUsed(
     GraphPtr pGraph
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

Return:

BOOL; TRUE/FALSE

 

TRUE=

O1-Axis is used

 

FALSE=

O1-Axis is not used

   

IsXAxisUsed()

 

This function returns TRUE/FALSE identifying whether or not the X axis is used in a given chart.

Syntax:

BOOL PUBLIC
IsXAxisUsed(
     GraphPtr pGraph
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

Return:

BOOL; TRUE/FALSE

 

TRUE=

X-Axis is used

 

FALSE=

X-Axis is not used

   

IsY1AxisUsed()

 

This function returns TRUE/FALSE identifying whether or not the Y1 axis is used in a given chart.

Syntax:

BOOL PUBLIC
IsY1AxisUsed(
     GraphPtr pGraph
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

Return:

BOOL; TRUE/FALSE

 

TRUE=

Y1-Axis is used

 

FALSE=

Y1-Axis is not used

   

IsY2AxisUsed()

 

This function returns TRUE/FALSE identifying whether or not the Y2 axis is used in a given chart.

Syntax:

BOOL PUBLIC
IsY2AxisUsed(
     GraphPtr pGraph
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

Return:

BOOL; TRUE/FALSE

 

TRUE=

Y2-Axis is used

 

FALSE=

Y2-Axis is not used

   

IsY3AxisUsed()

 

This function returns TRUE/FALSE identifying whether or not the Y3 axis is used in a given chart.

Syntax:

BOOL PUBLIC
IsY3AxisUsed(
     GraphPtr pGraph
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

Return:

BOOL; TRUE/FALSE

 

TRUE=

Y3-Axis is used

 

FALSE=

Y3-Axis is not used

   

IsY4AxisUsed()

 

This function returns TRUE/FALSE identifying whether or not the Y4 axis is used in a given chart.

Syntax:

BOOL PUBLIC
IsY4AxisUsed(
     GraphPtr pGraph
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

Return:

BOOL; TRUE/FALSE

 

TRUE=

Y4-Axis is used

 

FALSE=

Y4-Axis is not used

   

PlaceDefaultElements()

 

This is a multi-purpose function that is designed to place any 2D chart element into a "nice" default position. It does automatic layout of the chart so that chart objects do not overlap and everything has nice default sizes and positions. The most common usage is in scenarios where many (dozens or hundreds) of charts with different data sets are being spooled. If only a regular template is used, invariably some of the charts will look bad -- labels too small, legend too big, etc. This function adjusts for this condition, on-the-fly, by adjusting each chart to the data each chart contains.

Syntax:

INT16 PUBLIC
PlaceDefaultElements(
     DrawEnvPtr pDE,
     GraphPtr pGraph,
     UINT32 nElement, //IN: OR Flags -
     INT16 nLegendPlacement
);

Input:

pDE: Pointer to a draw environment created by AllocDrawEnvPtr()

 

pGraph: Pointer to the graph object created by AllocGraphPtr()

 

nElement; One or more of the following #defined element codes:

 

#define

value

Description

 

EFRAME

0x0001

Default Frame position

 

ETITLE

0x0002

Default Title position

 

ESUBTITLE

0x0004

Default SubTitle position

 

EFOOTNOTE

0x0008

Default Footnote position

 

EY1TITLE

0x0010

Default Y1-Axis title position

 

EY2TITLE

0x0020

Default Y2-Axis title position

 

EXTITLE

0x0040

Default X-Axis title position

 

EMOVABLELABELS

0x0080

Restore Movable labels to base positions

 

ELEGEND

0x0100

Recalculate size of Legend

 

EY1LABEL

0x0200

Recalculate Y1-Axis Labels to fit

 

EY2LABEL

0x0400

Recalculate Y2-Axis Labels to fit

 

EXLABEL

0x0800

Recalculate X-Axis Labels to fit

 

EDEFAULTLABELSIZE

0x1000

Resize label to 10-point while putting in its default location

 

EDATATEXT

0x2000

Recalculate data labels to fit

 

EMAXIMIZEFRAME

0x4000

When items are turned off, make frame use up empty space

 

EPIELABEL

0x8000

Fit pie labels on pie charts

 

ECLEARHILITES

0x10000

Clear ALL hilite information

 

E3DCUBE

0x20000

Reset 3D Cube to a default size and position

 

EDATAMARKERS

0x40000

Resize and adjust data markers

 

E3DDEFAULTCUBE

0x80000

Reset 3D Cube to a default size and position

 

nLegendPlacement; Legend placement code from the LegendPlacementType enum:

 

LegendPlacementType enum

Description

 

LEGEND_PLACEMENT_RIGHT (0)

Keep legend placement on the right side of the chart

 

LEGEND_PLACEMENT_LEFT (1)

Keep legend placement on the left side of the chart

 

LEGEND_PLACEMENT_BOTTOM (2)

Keep legend placement on the at the bottom of the chart

 

LEGEND_PLACEMENT_AUTO (3)

Automatic

Return:

INT16; E00_OK = Success. Any other E00_XXX error code = Error. See Appendix B for a list of error codes.

Notes:

In nLegendPlacement is set to LEGEND_PLACEMENT_AUTO, this function will determine the current placement of the legend and use LEGEND_PLACEMENT_RIGHT, LEGEND_PLACEMENT_LEFT, or LEGEND_PLACEMENT_BOTTOM to reposition the legend based on which position most closely matches the current legend placement.

Notes:

If nElement is set to EXLABEL for a 3D chart, PlaceDefaultElements() will check to see if any of the series or group labels in the chart overlap each other. If they do overlap, it will set 3D Label skipping appropriately (i.e., the A3D_SCALEFREQ_X, A3D_SCALEFREQ_Y, and A3D_SCALEFREQ_Z attributes).

Also See:

EnablePlaceDefaultElements(), HS_PlaceDefaultElements()

RecalcLegend()

 

This function adjusts the bounds and row/column count of legend. It should be called when a legend element changes sizes:

 

1)

More/Fewer Series

 

2)

Different Strings in Series

 

3)

OSG_LEGEND_TEXT font changes (size, name, style)

 

This function uses the value assigned to the A2D_LEGEND_LOCK attribute to determine how the legend should be recalculated. If A2D_LEGEND_LOCK is set to LEGEND_FREE_FLOAT, the legend can be recalculated to fit anywhere. If A2D_LEGEND_LOCK is set to LEGEND_FREE_RIGHT, RecalcLegend() recalculates the legend on the right side of the chart. If A2D_LEGEND_LOCK is set to LEGEND_FREE_LEFT, RecalcLegend() recalculates the legend on the left side of the chart. If A2D_LEGEND_LOCK is set to LEGEND_FREE_BOTTOM, RecalcLegend() recalculates the legend at the bottom of the chart. This function sets A2D_LEGEND_LOCK to LEGEND_FREE_FLOAT.

Syntax:

INT16 PUBLIC
RecalcLegend(
     DrawEnvPtr pDE,
     GraphPtr G
);

Input:

pDE: Pointer to a draw environment created by AllocDrawEnvPtr()

 

G: Pointer to the graph object created by AllocGraphPtr()

Return:

INT16:

 

Possible Values

Description

 

E00_OK =

Success

 

Any other value =

Standard System Error Code

Also See:

GetLegendLayoutInformation()

   

SetGraphDocSize()

 

This function sets the chart document width and height in pixels. This function and GetGraphDocSize() are utility functions that can be used to store a set of "physical" dimensions for a chart (e.g., 640 x 480 pixels, start at hDC position 13,34).

Syntax:

VOID PUBLIC
SetGraphDocSize (
     GraphPtr pGraph,
     REAL Width,
     REAL Height
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

 

pWidth: Width of graph in pixels

 

pHeight: Height of graph in pixels

Return:

None

Also See:

GetGraphDocSize()

   

SetGraphResolutionUnit()

 

This function sets the resolution units of a graph.

Syntax:

VOID PUBLIC
SetGraphResolutionUnit(
     GraphPtr pGraph,
     INT16 nUnit
);

Input:

pGraph: A graph pointer allocated by AllocGraphPtr()

Return:

nUnit; 0...3

 

UNIT_INCHES (0) =

Inches

 

UNIT_CM (1) =

Centimeters

 

UNIT_PIXELS (2) =

Pixels

 

UNIT_HIMETRICS (3) =

1/100 of mm

Return:

Void

Also See:

GetGraphResolutionUnit()