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_analyzescatter() fill chart environment for a scatter chart</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _pg_analyzescatter()    Fill chart environment for a scatter chart

 #include   <pgchart.h>

 short _pg_analyzescatter(env, xvalues, yvlaues, n);
 chartenv _far *env;            Environment variable
 float _far *xvalues;           Array of x values
 float _far *yvalues;           Array of y values
 short n;                       Number of points

    _pg_analyscatter() takes the values you supply in the arrays
    xvalues and yvalues and fills a chart environment variable
    with the default values for a scatter chart. All arguments in
    xvalues and yvalues are the same as those for _pg_chartscatter().

    Returns:         0 for success; nonzero otherwise.

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

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

     Here, _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_chartscatter() _pg_defaultchart() _pg_initchart()

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