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

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

Description:
    The _pg_analyzescatter functions analyze either a single-series or a
    multi-series scatter chart.  These functions calculate default values
    for chart elements without actually displaying the chart.

    The _pg_analyzescatter function analyzes a single-series scatter chart.
    The chart environment structure env is filled with default values based
    on the values of the x and y arguments.  The arguments are the same as
    for the  _pg_chartscatter function.

    The _pg_analyzescatterms function analyzes a multi-series scatter chart.
     The chart environment structure env is filled with default values based
    on the values of the x, y and labels arguments.  The arguments are the
    same as for the  _pg_chartscatterms function.

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

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

    #if defined ( __386__ )
        #define _FAR
    #else
        #define _FAR    __far
    #endif

    #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_analyzescatterms( &env, x, y, NUM_SERIES,
                              NUM_VALUES, NUM_VALUES, labels );
        /* display x-axis labels with 2 decimal places */
        env.xaxis.autoscale = 0;
        env.xaxis.ticdecimals = 2;
        _pg_chartscatterms( &env, x, y, NUM_SERIES,
                            NUM_VALUES, NUM_VALUES, labels );
        getch();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
     _pg_analyzescatter - DOS, QNX

    _pg_analyzescatterms - DOS, QNX

See Also:
    _pg_defaultchart, _pg_initchart, _pg_chart, _pg_chartpie,
    _pg_chartscatter, _pg_analyzechart, _pg_analyzepie

See Also: _pg_defaultchart _pg_initchart

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