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/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <pgchart.h>
    short _FAR _pg_chartscatter( chartenv _FAR *env,
                                 float _FAR *x,
                                 float _FAR *y, short n );

    short _FAR _pg_chartscatterms( chartenv _FAR *env,
                                   float _FAR *x,
                                   float _FAR *y,
                                   short nseries,
                                   short n, short dim,
                                   char _FAR * _FAR *labels );

Description:
    The _pg_chartscatter functions display either a single-series or a
    multi-series scatter chart.  The chart is displayed using the options
    specified in the env argument.

    The _pg_chartscatter function displays a scatter chart from the single
    series of data contained in the arrays x and y.  The argument n
    specifies the number of values to chart.

    The _pg_chartscatterms function displays a multi-series scatter chart.
     The argument nseries specifies the number of series of data to chart.
     The arguments x and y are assumed to be two-dimensional arrays defined
    as follows:


         float x[ nseries ][ dim ];

    The number of values used from each series is given by the argument n,
    where n is less than or equal to dim.  The argument labels is an array
    of strings.  These strings describe each of the series and are used in
    the chart legend.

Returns:
    The _pg_chartscatter functions return zero if successful; otherwise, a
    non-zero value is returned.

See Also:
    _pg_defaultchart, _pg_initchart, _pg_chart, _pg_chartms, _pg_chartpie,
    _pg_analyzechart, _pg_analyzechartms, _pg_analyzepie, _pg_analyzescatter, _pg_analyzescatterms

Example:
    #include <graph.h>
    #include <pgchart.h>
    #include <string.h>
    #include <conio.h>

    #define NUM_VALUES 4
    #define NUM_SERIES 2

    char _FAR *labels[ NUM_SERIES ] = {
        "Jan", "Feb"
    };

    float x[ NUM_SERIES ][ NUM_VALUES ] = {
        5, 15, 30, 40, 10, 20, 30, 45
    };

    float y[ NUM_SERIES ][ NUM_VALUES ] = {
        10, 15, 30, 45, 40, 30, 15, 5
    };

    main()
    {
        chartenv env;

        _setvideomode( _VRES16COLOR );
        _pg_initchart();
        _pg_defaultchart( &env,
                          _PG_SCATTERCHART, _PG_POINTANDLINE );
        strcpy( env.maintitle.title, "Scatter Chart" );
        _pg_chartscatterms( &env, x, y, NUM_SERIES,
                            NUM_VALUES, NUM_VALUES, labels );
        getch();
        _setvideomode( _DEFAULTMODE );
    }

    produces the following:

    The graphical image cannot be reproduced here. See the printed
    version of the manual.

Classification:
    PC Graphics

Systems:
     _pg_chartscatter - DOS, QNX

    _pg_chartscatterms - DOS, QNX

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