Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <pgchart.h>
    short _FAR _pg_defaultchart( chartenv _FAR *env,
                                 short type, short style );

Description:
    The _pg_defaultchart function initializes the chart structure env to
    contain default values before a chart is drawn.  All values in the chart
    structure are initialized, including blanking of all titles.  The chart
    type in the structure is initialized to the value type, and the chart
    style is initialized to style.

    The argument type can have one of the following values:

    _PG_BARCHART
        Bar chart (horizontal bars)

    _PG_COLUMNCHART
        Column chart (vertical bars)

    _PG_LINECHART
        Line chart

    _PG_SCATTERCHART
        Scatter chart

    _PG_PIECHART
        Pie chart

    Each type of chart can be drawn in one of two styles.  For each chart
    type the argument style can have one of the following values:


         Type            Style 1                 Style 2

         Bar             _PG_PLAINBARS           _PG_STACKEDBARS
         Column          _PG_PLAINBARS           _PG_STACKEDBARS
         Line            _PG_POINTANDLINE        _PG_POINTONLY
         Scatter         _PG_POINTANDLINE        _PG_POINTONLY
         Pie             _PG_PERCENT             _PG_NOPERCENT

    For single-series bar and column charts, the chart style is ignored.
     The "plain" (clustered) and "stacked" styles only apply when there is
    more than one series of data.  The "percent" style for pie charts causes
    percentages to be displayed beside each of the pie slices.

Returns:
    The _pg_defaultchart function returns zero if successful; otherwise, a
    non-zero value is returned.

Example:
    #include <graph.h>
    #include <pgchart.h>
    #include <string.h>
    #include <conio.h>

    #if defined ( __386__ )
        #define _FAR
    #else
        #define _FAR    __far
    #endif

    #define NUM_VALUES 4

    char _FAR *categories[ NUM_VALUES ] = {
        "Jan", "Feb", "Mar", "Apr"
    };

    float values[ NUM_VALUES ] = {
        20, 45, 30, 25
    };

    main()
    {
        chartenv env;

        _setvideomode( _VRES16COLOR );
        _pg_initchart();
        _pg_defaultchart( &env,
                          _PG_COLUMNCHART, _PG_PLAINBARS );
        strcpy( env.maintitle.title, "Column Chart" );
        _pg_chart( &env, categories, values, NUM_VALUES );
        getch();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

See Also:
    _pg_initchart, _pg_chart, _pg_chartpie, _pg_chartscatter

See Also: _pg_initchart _pg_chartpie

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson