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_analyzechartms() fill chart environment with a series of data</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _pg_analyzechartms()    Fill chart environment with a series of data

 #include   <pgchart.h>

 short _pg_analyzechartms(env, categs, values, nseries, n, adim, slabels);
 chartenv _far *env;                    Chart Environment
 char _far *_far *categs;               Array of category variables
 float _far *values;                    Data values
 short nseries;                         Number of series you want to chart
 short n;                               Number of data values to chart
 short adim;                            Row dim of data array
 char _far *_far *slabels;              Array of labels for series

    _pg_analyzechartms() takes the values you supply in the array
    values and fills a chart environment variable with the default
    values for multiseries bar, column or line type charts (as set by
    the call to _pg_defaultchart()). All arguments in categs and
    values are the same as those for _pg_chartms().

    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_analyzechart() _pg_chart() _pg_chartms() _pg_initchart()

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