home *** CD-ROM | disk | FTP | other *** search
- #include "eg_proto.h"
-
- /* value for the bottom unit of the bar, if you have many bar, you need
- change the value */
- float td_large=60.0;
- float td_medim=45.0;
- float td_small=30.0;
-
- /* height of the base, if set to zero which means no base */
- float td_baseh=0.0;
-
- /* colors around bars */
- int wall_c=0; /* color to be used for the solid fill of the frame */
- int grid_c=12; /* color to be used for the boundary of the frame */
- int base_c=0; /* color to be used for the solid fill of the base area */
-
- /* default color for the bar */
- int td_t_c=15; /* top or bottom color */
- int td_l_c=9; /* left side color */
- int td_r_c=1; /* right side color */
- int td_b_c=4; /* boundary color of the bar */
-
- /* total bars will be */
- int td_ttbar; /* count from 1, not 0 */
-
- /* flag for using labels or not */
- int tdlab_flag[6]={0,0,0,0,0,0}; /* 0: base left */
- /* 1: base right */
- /* 2: xy plane left */
- /* 3: xy plane right */
- /* 4: xz plane */
- /* 5: yz plane */
-
- /* draw middle plane flag */
- int mid_pl_c=0; /* color to be used for the solid fill of the middle plane */
- int draw_midp_flag=0; /* 1- draw the middle plane, 0- not drawing it */
- float middlep_value=0.0; /* value for the middle plane */
-
- /* store information of labels */
- tdlabels tdbarlab[6]; /* 6 different kinds labels */
-
- /* store data for bar */
- baritem *_esbar; /* holding permantly */
- coord3d *_tdpts; /* holding each bars vertex' points */
- int *barptr; /* point to which bar's value should use */
- stack_cr *_stackc; /* colors of stack bar */
-
- /* the attribute for the bar chart */
- int tdbarkind=-9999; /* 0- cubebar 1- pyramid 2- octahedron 3- stacked bar */
- int td_barx; /* how many bars along the X axis */
- int td_bary; /* how many bars along the Y axis */
- int tdstkseg=1; /* how many segments in the stack bars */
- int tdlegndf=0; /* flag for the legend (only for bar); 0- no legend, 1- yes */
- int tdtitlef=0; /* flag for the title; 0- no title, 1- yes */
-
- /* temporarily save the viewport */
- int tempeview[4]={-9999,-9999,-9999,-9999};
- int tempeviewflag=0;
-
- /* for the legend */
- tdlegend *_legend;
-
- /* for 3D pie */
- td_htpie *_espie; /* holding whole data for stacked bars */
- int td_ttpie=-9999; /* count from 1, not 0; also is flag, just make sure
- tdpieset() was called */
- int pie_top; /* top of the pie; which ma should around 90 */
- int pie_bot; /* top of the pie; which ma should around 270 */
- int pie_left; /* left of the pie; which ma should around 180 */
- /* right of the pie is always 0 */
- int td_top; /* the biggest Y value in this pie */
- int td_bot; /* the smallest Y value in this pie */
- int td_right; /* the biggest X value in this pie */
- int td_left; /* the smallest Y value in this pie */
- int tdpiefn; /* font number to use for the labels */
- int labelgap=5; /* gap between each labels (horizontally) */
- int pielabgap=9; /* gap between the border (eg td_top, td_left..) and
- labels that will be either right or left adjustified
- (it depends on radius) */
- int exp_pixel=40; /* how many pixels between label and td_??? */
- int tdpiepos; /* position of the labels */
- int tdpielocation; /* location of the legend */
- int tdpiestyle; /* style of the legend */
- int tdlabelc=12; /* labels' color */
- int tdlablnc=12; /* label's line color */
- int td_width=0; /* width of the pie (default is 2D) */
- int label_height; /* the height of the label */
- int need_adjust_no=5;/* if more than this number, then adjustified anyway */
-
- /* size around the 3D frame */
- float tdbasex,tdbasey; /* the bottom size for each bar */
- float tdbasez=60.0; /* grid length in Z-axis */
-
- /* array for 3D perspective */
- float v[4][4]; /* define the 4 * 4 matrix (for perspective) */
-
- /* coordinate for 3D between real world and screen */
- sphr_crd coord_s; /* theta, phi, rho and sd */
- coord3d objcp; /* center point for the real world */
-
- /* for the relationship between label and frame */
- int reverse_flag=0; /* 0- do not reverse (0<=theta<90) */
- /* 1- reverse new xy plane left (90<=theta<180) */
- /* 2- reverse new xy plane both sides (180<=theta<270) */
- /* 3- reverse new xy plane right (270<=theta<360) */
-
- /* space between graph and viewport (The values will be changed in tdbarset()
- because of the resolution. Also can call the function td_graph_dim() to
- change it.) */
- float size_to_bottom=60.0;
- float size_to_top=20.0;
- float size_to_left=40.0,size_to_right=40.0;
-
- /* label between each plane */
- float label_xyplane=10.0;
- float label_xzplane=8.0;
- float label_yzplane=8.0;
-
- /* save the original world & viewport */
- int per_view[4];
- int per_world[4];
-
- void bar_ext()
- {
- tdlegndf=0; /* flag for the legend (only for bar); 0- no legend, 1- yes */
- tdtitlef=0; /* flag for the title; 0- no title, 1- yes */
- tempeviewflag=0;
- }