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_initchart( void );

Description:
    The _pg_initchart function initializes the presentation graphics system.
     This includes initializing the internal palette and style-set used when
    drawing charts.  This function must be called before any of the other
    presentation graphics functions.

    The initialization of the presentation graphics system requires that a
    valid graphics mode has been selected.  For this reason the
     _setvideomode function must be called before _pg_initchart is called.
     If a font has been selected (with the  _setfont function), that font
    will be used when text is displayed in a chart.  Font selection should
    also be done before initializing the presentation graphics system.

Returns:
    The _pg_initchart 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_defaultchart, _pg_chart, _pg_chartpie, _pg_chartscatter,
    _setvideomode, _setfont, _registerfonts

See Also: _pg_defaultchart _pg_chartpie

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