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

 #include   <pgchart.h>

 short _pg_analyzechart(env, categories, values, n);
 chartenv _far *env;            Chart Environment type variable
 char _far *_far *categories;   Array of category variables
 float _far *values;            Data values for the chart
 short n;                       Number of data values

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

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

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