gdc_samp1.c

Go to the documentation of this file.
00001 /* GDCHART 0.94b  1st CHART SAMPLE  12 Nov 1998 */
00002 
00003 /* writes gif file to stdout */
00004 
00005 /* sample gdchart usage */
00006 /* this will produce a 3D BAR chart */
00007 /* this is suitable for use as a CGI */
00008 
00009 /* for CGI use un-comment the "Content-Type" line */
00010 
00011 #include <stdio.h>
00012 #include <values.h>
00013  
00014 #include "gdc.h"
00015 #include "gdchart.h"
00016  
00017 main()
00018 {
00019     /* ----- set some data ----- */
00020     float   a[6]  = { 0.5, 0.09, 0.6, 0.85, 0.0, 0.90 },
00021             b[6]  = { 1.9, 1.3,  0.6, 0.75, 0.1, 2.0 };
00022     /* ----- X labels ----- */
00023     char    *t[6] = { "Chicago", "New York", "L.A.", "Atlanta", "Paris, MD\n(USA) ", "London" };
00024     /* ----- data set colors (RGB) ----- */
00025     unsigned long   sc[2]    = { 0xFF8080, 0x8080FF };
00026  
00027     GDC_BGColor   = 0xFFFFFFL;                  /* backgound color (white) */
00028     GDC_LineColor = 0x000000L;                  /* line color      (black) */
00029     GDC_SetColor  = &(sc[0]);                   /* assign set colors */
00030 
00031         GDC_stack_type = GDC_STACK_BESIDE;
00032 //    printf( "Content-Type: image/gif\n\n" );    /* tell browser type */
00033 
00034                               /* ----- call the lib ----- */
00035     out_graph( 250, 200,      /* short       width, height */
00036                stdout,        /* FILE*       open FILE pointer */
00037                GDC_3DBAR,     /* GDC_CHART_T chart type */
00038                6,             /* int         number of points per data set */
00039                t,             /* char*[]     array of X labels */
00040                2,             /* int         number of data sets */
00041                a,             /* float[]     data set 1 */
00042                b );           /*  ...        data set n */
00043 
00044     exit(0);
00045 }

Generated on Sat Dec 15 00:00:57 2007 for BulmaGes by  doxygen 1.5.1