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

Description:
    The _pg_chartpie function displays a pie chart.  The chart is displayed
    using the options specified in the env argument.

    The pie chart is created from the data contained in the values array.
     The argument n specifies the number of values to chart.

    The argument cat is an array of strings.  These strings describe each of
    the pie slices and are used in the chart legend.  The argument explode
    is an array of values corresponding to each of the pie slices.  For each
    non-zero element in the array, the corresponding pie slice is drawn
    "exploded", or slightly offset from the rest of the pie.

Returns:
    The _pg_chartpie 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
    };

    short explode[ NUM_VALUES ] = {
        1, 0, 0, 0
    };

    main()
    {
        chartenv env;

        _setvideomode( _VRES16COLOR );
        _pg_initchart();
        _pg_defaultchart( &env,
                          _PG_PIECHART, _PG_NOPERCENT );
        strcpy( env.maintitle.title, "Pie Chart" );
        _pg_chartpie( &env, categories,
                      values, explode, NUM_VALUES );
        getch();
        _setvideomode( _DEFAULTMODE );
    }

    produces the following:



Classification:
    PC Graphics

Systems:
    DOS, QNX

See Also:
    _pg_defaultchart, _pg_initchart, _pg_chart, _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