Watcom C Library Reference : perror, _pg_analyzechart, _pg_analyzechartms, _pg_analyzepie, _pg_analyzescatter, _pg_analyzescatterms

 

 

 

 

perror

 

Synopsis : #include <stdio.h> 

              void perror( const char *prefix );

 


Description : The perror function prints, on the file designated by stderr, the error message corresponding to the error number contained in errno. The perror function writes first the string pointed to by prefix to stderr. This is followed by a colon (":"), a space, the string returned by strerror(errno), and a newline character.

 

 

Returns : The perror function returns no value. Because the function uses the fprintf function, errno can be set when an error is detected during the execution of that function.

 

 

See Also : strerror

 


Example :

#include <stdio.h>

 

void main( )

{
    FILE     *fp;
   

    fp = fopen( "data.fil", "r" );

    if( fp == NULL ) {
        perror( "Unable to open file" );

    }

}

 

Classification : ANSI
Systems : All

 

 

 

 

 

_pg_analyzechart, _pg_analyzechartms

 

Synopsis : #include <pgchart.h> 

              short _FAR _pg_analyzechart( chartenv _FAR *env,
                                               char _FAR *_FAR *cat,

                                               float _FAR *values, short n );


              short _FAR _pg_analyzechartms( charteny _FAR *env,
                                                  char _FAR *_FAR *cat,

                                                  float _FAR *values,

                                                  short nseries,

                                                  short n, short dim,

                                                  char _FAR * _FAR *labels );


Description : The _pg_analyzechart functions analyze either a single-series or a multi-series bar, columnor line chart. These functions calculate default values for chart elements without actually displaying the chart.


The _pg_analyzechart function analyzes a single-series bar, column or line chart. The chart environment structure env is filled with default values based on the type of chart and the values of the cat and values arguments. The arguments are the same as for the _pg_chart function.


The _pg_analyzechartms function analyzes a multi-series bar, column or line chart. The chart environment structure env is filled with default values based on the type of chart and the values of the cat, values and labels arguments. The arguments are the same as for the _pg_chartms function.

 

 

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

 

 

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

 


Example :

#include <graph.h> 

#include <pgchart.h> 

#include <string.h> 

#include <conio.h>


#define NUM_VALUES     4


char _FAR *categories [NUM_VALUES] = {
"Jan", "Feb", "Mar", "Apr" };
float values [NUM_VALUES] = { 20, 45, 30, 25 };


main( )

{
    chartenv env;


    _setvideomode( _VRES16COLOR );

    _pg_initchart( );

    _pg_defaultchart( &eny, _PG_COLUMNCHART, _PG_PLAINBARS ); 

    strcpy( env.maintitle.title, "Column Chart" );

    _pg_analyzechart( &eny, categories, values, NUM_VALUES ); 

 

    /* use manual scaling */

    env.yaxis.autoscale = 0;

    env.yaxis.scalemin = 0.0;

    env.yaxis.scalemax = 100.0;

    env.yaxis.ticinterval = 25.0;

 

    _pg_chart( &env, categories, values, NUM_VALUES );

    getch( );

 

    _setvideomode( _DEFAULTMODE );

}

 

Classification : PC Graphics
Systems : _pg_analyzechart - DOS, QNX
             _pg_analyzechartms -DOS, QNX

 

 

 

 

 

_pg_analyzepie

 

Synopsis : #include <pgchart.h> 

              short _FAR _pg_analyzepie( chartenv _FAR *env,
                                             char _FAR * _FAR *cat,

                                             float _FAR *values,

                                             short _FAR *explode, short n );


Description : The _pg_analyzepie function analyzes a pie chart. This function calculates default values for chart elements without actually displaying the chart.


The chart environment structure env is filled with default values based on the values of the catvalues and explode arguments. The arguments are the same as for the _pg_chartpie function.

 

 

Returns : The _pg_analyzepie function returns zero if successful; otherwise, a non-zero value is returned.

 

 

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



Example :

#include <graph.h> 

#include <pgchart.h> 

#include <string.h> 

#include <conio.h>


#define NUM_VALUES     4


char _FAR *categories[NUM_VALUES] = { "Jan", "Feb", "Mar", "Apr" };


float values[NUM_VALUES] = { 20, 45, 30, 25 };


short explode[NUM_VALUES] = { 1, 0, 0, 0 };


main( )

{
    chartenv env;


    _setvideomode( _VRES16COLOR );

    _pg_initchart( );

    _pg_defaultchart( &eny, _PG_PIECHART, _PG_NOPERCENT ); 

    strcpy( env.maintitle.title, "Pie Chart" );

    env.legend.place = _PG_BOTTOM;

    _pg_analyzepie ( &env, categories, values, explode, NUM_VALUES ); 

 

    /* make legend window same width as data window */

    eny.legend.autosize = 0;

    eny.legend.legendwindow.x1 = env.datawindow.x1;

    eny.legend.legendwindow.x2 = env.datawindow.x2;

    _pg_chartpie( &eny, categories, values, explode, NUM_VALUES ); 

 

    getch( );

    _setvideomode( _DEFAULTMODE );

}

 

Classification : PC Graphics
Systems : DOS, QNX

 

 

 

 

 

 

_pg_analyzescatter, _pg_analyzescatterms

 

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.

 

 

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

 


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( &eny, _PG_SCATTERCHART, _PG_POINTANDLINE ); 

    strcpy( eny.maintitle.title, "Scatter Chart" );

    _pg_analyzescatterms( &env, x, y, NUM_SERIES, NUM_VALUES, NUM_VALUES, labels ); 

   

    /* display x-axis labels with 2 decimal places */

    eny.xaxis.autoscale = 0;

    eny.xaxis.ticdecimals = 2;

    _pg_chartscatterms( denv, x, y, NUM_SERIES, NUM_VALUES, NUM_VALUES, labels ); 

 

    getch( );

    _setvideomode( _DEFAULTMODE );

}

 

Classification : PC Graphics
Systems : _pg_analyzescatter -DOS, QNX 

             _pg_analyzescatterms -DOS, QNX

 

 

 

 

 

 

 

This manual describes the WATCOM C library for DOS, Windows, and OS/2, It includes the Standard C Library (as defined in the ANSI C Standard).

 

WATCOM C Language Reference manual describes the ANSI C Programming language and extensions to it which are supported by WATCOM C/C++ (32bit)

 

 

 

728x90
반응형
Posted by 전화카드
,