1 | // |
---|
2 | // "$Id: Fl_Chart.H 2918 2003-01-19 07:55:01Z spitzak $" |
---|
3 | // |
---|
4 | // Forms chart header file for the Fast Light Tool Kit (FLTK). |
---|
5 | // |
---|
6 | // Copyright 1998-2003 by Bill Spitzak and others. |
---|
7 | // |
---|
8 | // This library is free software; you can redistribute it and/or |
---|
9 | // modify it under the terms of the GNU Library General Public |
---|
10 | // License as published by the Free Software Foundation; either |
---|
11 | // version 2 of the License, or (at your option) any later version. |
---|
12 | // |
---|
13 | // This library is distributed in the hope that it will be useful, |
---|
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | // Library General Public License for more details. |
---|
17 | // |
---|
18 | // You should have received a copy of the GNU Library General Public |
---|
19 | // License along with this library; if not, write to the Free Software |
---|
20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
---|
21 | // USA. |
---|
22 | // |
---|
23 | // Please report all bugs and problems to "fltk-bugs@fltk.org". |
---|
24 | // |
---|
25 | |
---|
26 | #ifndef Fl_Chart_H |
---|
27 | #define Fl_Chart_H |
---|
28 | |
---|
29 | #include <fltk/Widget.h> |
---|
30 | |
---|
31 | // values for type() |
---|
32 | #define FL_BAR_CHART 0 |
---|
33 | #define FL_HORBAR_CHART 1 |
---|
34 | #define FL_LINE_CHART 2 |
---|
35 | #define FL_FILL_CHART 3 |
---|
36 | #define FL_SPIKE_CHART 4 |
---|
37 | #define FL_PIE_CHART 5 |
---|
38 | #define FL_SPECIALPIE_CHART 6 |
---|
39 | |
---|
40 | #define FL_FILLED_CHART FL_FILL_CHART // compatibility |
---|
41 | |
---|
42 | #define FL_CHART_MAX 128 |
---|
43 | #define FL_CHART_LABEL_MAX 18 |
---|
44 | |
---|
45 | struct FL_FORMS_API FL_CHART_ENTRY { |
---|
46 | float val; |
---|
47 | uchar col; |
---|
48 | char str[FL_CHART_LABEL_MAX+1]; |
---|
49 | }; |
---|
50 | |
---|
51 | class FL_FORMS_API Fl_Chart : public fltk::Widget { |
---|
52 | public: |
---|
53 | Fl_Chart(int,int,int,int,const char * = 0); |
---|
54 | ~Fl_Chart(); |
---|
55 | void clear(); |
---|
56 | void add(double, const char * =0, uchar=0); |
---|
57 | void insert(int, double, const char * =0, uchar=0); |
---|
58 | void replace(int, double, const char * =0, uchar=0); |
---|
59 | void bounds(double *a,double *b) const {*a = min; *b = max;} |
---|
60 | void bounds(double a,double b); |
---|
61 | int size() const {return numb;} |
---|
62 | int maxsize() const {return maxnumb;} |
---|
63 | void maxsize(int); |
---|
64 | uchar autosize() const {return autosize_;} |
---|
65 | void autosize(uchar n) {autosize_ = n;} |
---|
66 | |
---|
67 | protected: |
---|
68 | void draw(); |
---|
69 | |
---|
70 | private: |
---|
71 | uchar autosize_; |
---|
72 | int numb; |
---|
73 | int maxnumb; |
---|
74 | int sizenumb; |
---|
75 | FL_CHART_ENTRY *entries; |
---|
76 | double min,max; |
---|
77 | }; |
---|
78 | |
---|
79 | #endif |
---|
80 | |
---|
81 | // |
---|
82 | // End of "$Id: Fl_Chart.H 2918 2003-01-19 07:55:01Z spitzak $". |
---|
83 | // |
---|