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_getpalette( paletteentry _FAR *pal );

Description:
    The _pg_getpalette function retrieves the internal palette of the
    presentation graphics system.  The palette controls the colors, line
    styles, fill patterns and plot characters used to display each series of
    data in a chart.

    The argument pal is an array of palette structures that will contain the
    palette.  Each element of the palette is a structure containing the
    following fields:

    color
        color used to display series

    style
        line style used for line and scatter charts

    fill
        fill pattern used to fill interior of bar and pie sections

    plotchar
        character plotted on line and scatter charts


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

See Also:
    _pg_defaultchart, _pg_initchart, _pg_chart, _pg_chartms, _pg_chartpie,
    _pg_chartscatter, _pg_chartscatterms, _pg_setpalette, _pg_resetpalette

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
    };

    char bricks[ 8 ] = {
        0xff, 0x80, 0x80, 0x80, 0xff, 0x08, 0x08, 0x08
    };

    main()
    {
        chartenv env;
        palettetype pal;

        _setvideomode( _VRES16COLOR );
        _pg_initchart();
        _pg_defaultchart( &env,
                          _PG_COLUMNCHART, _PG_PLAINBARS );
        strcpy( env.maintitle.title, "Column Chart" );
        /* get default palette and change 1st entry */
        _pg_getpalette( &pal );
        pal[ 1 ].color = 12;
        memcpy( pal[ 1 ].fill, bricks, 8 );
        /* use new palette */
        _pg_setpalette( &pal );
        _pg_chart( &env, categories, values, NUM_VALUES );
        /* reset palette to default */
        _pg_resetpalette();
        getch();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

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