Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_pg_analyzepie() fill chart environment for a pie chart</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _pg_analyzepie()        Fill chart environment for a pie chart

 #include   <pgchart.h>

 short _pg_analyzepie(env, categs, values, explode, n);
 chartenv _far *env;            The chart environment variable
 char _far *_far *categs;       Array of category variables
 float _far *values;            The data values
 short _far *explode;           Array of 'explode' flags
 short n;                       Number of data values

    _pg_analyzpie() takes the values you supply in the array values
    and fills a chart environment variable with the default values for
    a pie chart. All arguments in categs and values are the
    same as those for _pg_chartpie().

    Returns:         0 for success; nonzero otherwise.

    Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                     compatibles

   -------------------------------- Example ---------------------------------

     In this program, _pg_analyzechartms() is used, but the same applies for
     _pg_analyzepie(), _pg_analyzechart(), _pg_analyzescatter(), and
     _pg_analyzescatterms().

    #include <conio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <graph.h>
    #include <pgchart.h>

    #define COUNTRIES 4
    #define MONTHS 4
    char _far *months[MONTHS] =  {"April", "May",  "June", "July"};
    char _far *country[COUNTRIES] = {"USA", "UK", "DDR", "USSR"};
    float _far mydata[COUNTRIES * MONTHS] =  {122.1,   311.2,   156.5,  211.5,
                                              121.1,   311.1,   234.3,  323.2,
                                              331.1,   123.4,   432.8,  312.4,
                                              443.3,   233.3,   233.1,  231.1};

    void main()
    {
        chartenv myenv;

        _setvideomode(_MAXRESMODE);
        _pg_initchart();

        _pg_defaultchart(&myenv, _PG_BARCHART, _PG_PLAINBARS);
        strcpy(myenv.maintitle.title, "Soybean Consumption");
        myenv.xaxis.autoscale = 1;  /* Set to true */

        _pg_analyzechartms(&myenv,months,mydata,COUNTRIES,MONTHS,
                                       MONTHS,country);
        _pg_chartms(&myenv, months, mydata, COUNTRIES, MONTHS,
                                       MONTHS, country);

        getch();
        }

See Also: _pg_chartpie() _pg_defaultchart() _pg_initchart()

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