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_chart( chartenv _FAR *env,
                          char _FAR * _FAR *cat,
                          float _FAR *values, short n );

    short _FAR _pg_chartms( chartenv _FAR *env,
                            char _FAR * _FAR *cat,
                            float _FAR *values, short nseries,
                            short n, short dim,
                            char _FAR * _FAR *labels );

Description:
    The _pg_chart functions display either a single-series or a multi-series
    bar, column or line chart.  The type of chart displayed and other chart
    options are contained in the env argument.  The argument cat is an array
    of strings.  These strings describe the categories against which the
    data in the values array is charted.

    The _pg_chart function displays a bar, column or line chart from the
    single series of data contained in the values array.  The argument n
    specifies the number of values to chart.

    The _pg_chartms function displays a multi-series bar, column or line
    chart.  The argument nseries specifies the number of series of data to
    chart.  The argument values is assumed to be a two-dimensional array
    defined as follows:


         float values[ nseries ][ dim ];

    The number of values used from each series is given by the argument n,
    where n is less than or equal to dim.  The argument labels is an array
    of strings.  These strings describe each of the series and are used in
    the chart legend.

Returns:
    The _pg_chart functions return 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 );
    }

    produces the following:



Classification:
    PC Graphics

Systems:
     _pg_chart - DOS, QNX

    _pg_chartms - DOS, QNX

See Also:
    _pg_defaultchart, _pg_initchart, _pg_chartpie, _pg_chartscatter,
    _pg_analyzechart, _pg_analyzepie, _pg_analyzescatter

See Also: _pg_defaultchart _pg_initchart

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