Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

OPIECHRT.H Source File
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

OPIECHRT.H

Go to the documentation of this file.
00001 //Filename    : Opiechrt.H
00002 //Description : Header of object PieChart
00003 
00004 #ifndef __OPIECHRT_H
00005 #define __OPIECHRT_H
00006 
00007 #include <OVGA.H>
00008 #include <OFONT.H>
00009 
00010 //--------- Define macro constant -----------//
00011 //--------- Define macro constant -----------//
00012 #ifndef __OGRAPHA2_H
00013 #ifndef __OGRPHYR_H
00014 enum {
00015     DATA_FLOAT = 1, DATA_DOUBLE = 2,
00016     DATA_INT = 3, DATA_LONG = 4
00017 };
00018 #endif
00019 #endif
00020 
00021 //--------- Define class PieChart --------//
00022 //
00024 class PieChart {
00025 public:
00026     short piechart_x1, piechart_y1, piechart_x2, piechart_y2;
00027     short series_x1, series_y1, series_x2, series_y2;
00028     short graph_height, graph_width;
00029     short legend_width, legend_height, legend_x_num, legend_y_num;
00030     char **legend_array, *x_label, *y_label;
00031     int *series_color, axis_color;
00032     char init_flag, transparent_flag, orientation_flag;
00033     char data_type_flag, value_flag;
00034     int num_format;
00035     int series_num, data_num;
00036     void *data_array;
00037     int *x_start, *x_end;
00038     int centerx,centery;
00039     int radius;
00040     short y_label_max_len;
00041 
00042 protected:
00043     char x_axis_pos;                              // 0-bottom, 1-center
00044     double max_scale;                             // max abs value of the graph
00045     short x_axis_step;                            // step size on x-axis
00046     Font *font_ptr;
00047     short *piechart_bitmap;
00048 
00049 public:
00050     PieChart();
00051     ~PieChart();
00052 
00053     void init(int,int,int,int,int,void*,char,int*,int*,char* =NULL,char* =NULL,char** =NULL,char=1,char=1,char=1,int=1,int* =NULL,int=Vga::active_buf->color_dark);
00054     void init(int x1,int y1,int x2,int y2,int dataNum,float* dataArray,int* xStart,int* xEnd,char* xLabel,char* yLabel,char** legendArray=NULL,char transparentFlag=1,char orientationFlag=1,char valueFlag=1,int numFormat=1,int* seriesColor=NULL,int axisColor=Vga::active_buf->color_dark)
00055         { init(x1, y1, x2, y2, dataNum, (void*) dataArray, DATA_FLOAT, xStart, xEnd, xLabel, yLabel, legendArray, transparentFlag, orientationFlag, valueFlag, numFormat, seriesColor, axisColor); }
00056     void init(int x1,int y1,int x2,int y2,int dataNum,double* dataArray,int* xStart,int* xEnd,char* xLabel,char* yLabel,char** legendArray=NULL,char transparentFlag=1,char orientationFlag=1,char valueFlag=1,int numFormat=1,int* seriesColor=NULL,int axisColor=Vga::active_buf->color_dark)
00057         { init(x1, y1, x2, y2, dataNum, (void*) dataArray, DATA_DOUBLE, xStart, xEnd, xLabel, yLabel, legendArray, transparentFlag, orientationFlag, valueFlag, numFormat, seriesColor, axisColor); }
00058     void init(int x1,int y1,int x2,int y2,int dataNum,int* dataArray,int* xStart,int* xEnd,char* xLabel,char* yLabel,char** legendArray=NULL,char transparentFlag=1,char orientationFlag=1,char valueFlag=1,int numFormat=1,int* seriesColor=NULL,int axisColor=Vga::active_buf->color_dark)
00059         { init(x1, y1, x2, y2, dataNum, (void*) dataArray, DATA_INT, xStart, xEnd, xLabel, yLabel, legendArray, transparentFlag, orientationFlag, valueFlag, numFormat, seriesColor, axisColor); }
00060     void init(int x1,int y1,int x2,int y2,int dataNum,long* dataArray,int* xStart,int* xEnd,char* xLabel,char* yLabel,char** legendArray=NULL,char transparentFlag=1,char orientationFlag=1,char valueFlag=1,int numFormat=1,int* seriesColor=NULL,int axisColor=Vga::active_buf->color_dark)
00061         { init(x1, y1, x2, y2, dataNum, (void*) dataArray, DATA_LONG, xStart, xEnd, xLabel, yLabel, legendArray, transparentFlag, orientationFlag, valueFlag, numFormat, seriesColor, axisColor); }
00062 
00063     void deinit();
00064     void paint();
00065     void refresh();
00066     void set_font(Font *);
00067     void calc_pos();
00068 
00069     void set_y_label_max_len(short yLabelMaxLen) { y_label_max_len = yLabelMaxLen; }
00070 
00071 protected:
00072     void draw_legend();
00073     void draw_axis_label();
00074     void find_scale();
00075     void draw_scale();
00076     void draw_pie(double,double,int);
00077     void draw_series();
00078     void draw_series_float();
00079     void draw_series_double();
00080     void draw_series_int();
00081     void draw_series_long();
00082     void draw_value(void *, int, short, short, int);
00083 
00084 };
00085 
00086 //--------------------------//
00087 #endif

Generated on Fri Aug 23 01:38:10 2002 for VirtualU by doxygen1.2.17