Presentation-Graphics Functions

The presentation-graphics functions are declared in the PGCHART.H include file. The library can be divided into the three categories listed below, corresponding to the different tasks involved in creating and manipulating graphic objects:

Category Task

Displaying presentation graphics Initializes video structures for presentation graphics and establishes the default chart type. Displays presentation-graphics chart: bar, column, pie, scatter, or line chart.
Analyzing presentation-graphics data Analyzes data (does not display chart).
Manipulating presentation-graphics structures Modifies basic chart structures (e.g., palettes, cross-hatching styles).

Displaying Presentation Graphics

The functions listed in this section initialize the presentation-graphics library and display the specified graph type.

Because the _pg_initchart routine initializes the presentation-graphics library, it must be called before any other function in the presentation-graphics library. The _pg_defaultchart function initializes the variables in the chart environment.

The other routines in this category display the specified graph. The single-series versions plot one set of data, and the multiseries versions (those ending with an ms suffix) plot several sets of data in the same chart style.

Presentation-graphics programs can display text in different font sizes by taking advantage of font-based characters (see the previous section, “Displaying Fonts”). Call the _registerfonts and _setfont routines to select a font before calling the _pg_initchart routine. Subsequent charts use the selected font. You can later call the _unregisterfonts routine to restore the default character font and free the memory previously allocated for fonts.

Note:

If your program uses the alternate math package—if it is compiled with /FPa—it cannot use the PGCHART.LIB module.

Routine Use

_pg_chart Displays a single-series bar, column, or line chart
_pg_chartms Displays a multiseries bar, column, or line chart
_pg_chartpie Displays a pie chart
_pg_chartscatter Displays a scatter diagram for a single series of data
_pg_chartscatterms Displays a scatter diagram for more than one series of data
_pg_defaultchart Initializes all necessary variables in the chart environment for a specified chart type
_pg_initchart Initializes the presentation-graphics library

Analyzing Presentation-Graphics Charts

These routines calculate default values for the specified graph type but do not display the chart. The single-series versions analyze one set of data, and the multi-series versions analyze several sets of data in the same chart style.

Routine Use

_pg_analyzechart Analyzes a single series of data for a bar, column, or line chart
_pg_analyzechartms Analyzes a multiseries of data for a bar, column, or line chart
_pg_analyzepie Analyzes data for a pie chart
_pg_analyzescatter Analyzes a single series of data for a scatter diagram
_pg_analyzescatterms Analyzes a multiseries of data for a scatter diagram

Manipulating Presentation-Graphics Structures

These functions control low-level aspects of the presentation-graphics package.

Routine Use

_pg_getchardef Retrieves the current 8-by-8-pixel bit map for a specified character
_pg_getpalette Retrieves current colors, line styles, fill patterns, and plot characters for all presentation-graphics palettes
_pg_getstyleset Retrieves the contents of the current styleset
_pg_hlabelchart Writes text horizontally on the screen
_pg_resetpalette Sets current colors, line styles, fill patterns, and plot characters to the default values for the current screen mode
_pg_resetstyleset Resets the contents of the current styleset to the default value for the current screen mode
_pg_setchardef Sets the 8-by-8-pixel bit map for a specified character
_pg_setpalette Sets current colors
_pg_setstyleset Sets the contents of the current styleset
_pg_vlabelchart Writes text vertically on the screen