Initializes the chart environment.
#include <pgchart.h>
short __far _pg_defaultchart( _chartenv __far *env, short charttype,
short chartstyle );
env | Chart environment structure | |
charttype | Chart type | |
chartstyle | Chart style |
The _pg_defaultchart function initializes all necessary variables in the chart environment for the chart type by the variable charttype.
All title fields in the environment structure are blanked. Titles should be set in the proper fields after calling _pg_defaultchart.
The charttype variable can be set to one of the following manifest constants:
Chart Type | Description |
_PG_BARCHART | Bar chart |
_PG_COLUMNCHART | Column chart |
_PG_LINECHART | Line chart |
_PG_PIECHART | Pie chart |
_PG_SCATTERCHART | Scatter chart |
The chartstyle variable specifies the style of the chart with either the number “1” or the number “2.” Each of the five types of presentation-graphics charts can appear in two different chart styles, as described below:
Chart Type | Chart Style 1 | Chart Style 2 |
Bar | Side by side | Stacked |
Column | Side by side | Stacked |
Line | Points with lines | Points only |
Pie | Percent | No percent |
Scatter | Points with lines | Points only |
In a pie chart, the pieces are “exploded” according to the explode array argument in the _pg_chartpie function. In the “percent” format, percentages are printed next to each slice. Bar and column charts have only one style when displaying a single series of data. The styles “side by side” and “stacked” are applicable only when more than one series appears on the same chart. The first style arranges the bars or columns for the different series side by side, showing relative heights or lengths. The stacked style emphasizes relative sizes between bars and columns.
The _pg_defaultchart function returns 0 if there were no errors. A nonzero value indicates a failure.
Standards:None
16-Bit:DOS
32-Bit:None
_pg_getchardef, _pg_getpalette, _pg_getstyleset, _pg_hlabelchart, _pg_initchart, _pg_resetpalette, _pg_resetstyleset, _pg_setchardef, _pg_setpalette, _pg_setstyleset, _pg_vlabelchart
See the example for _pg_chart.