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

Description:
    The _pg_analyzepie function analyzes a pie chart.  This function
    calculates default values for chart elements without actually displaying
    the chart.

    The chart environment structure env is filled with default values based
    on the values of the cat, values and explode arguments.  The arguments
    are the same as for the  _pg_chartpie function.

Returns:
    The _pg_analyzepie 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" );
        env.legend.place = _PG_BOTTOM;
        _pg_analyzepie( &env, categories,
                        values, explode, NUM_VALUES );
        /* make legend window same width as data window */
        env.legend.autosize = 0;
        env.legend.legendwindow.x1 = env.datawindow.x1;
        env.legend.legendwindow.x2 = env.datawindow.x2;
        _pg_chartpie( &env, categories,
                      values, explode, NUM_VALUES );
        getch();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

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

See Also: _pg_defaultchart _pg_initchart

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