2 // "$Id: Fl_Chart.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
4 // Forms chart header file for the Fast Light Tool Kit (FLTK).
6 // Copyright 1998-2002 by Bill Spitzak and others.
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.
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.
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
23 // Please report all bugs and problems to "fltk-bugs@fltk.org".
30 #include "Fl_Widget.H"
34 #define FL_BAR_CHART 0
35 #define FL_HORBAR_CHART 1
36 #define FL_LINE_CHART 2
37 #define FL_FILL_CHART 3
38 #define FL_SPIKE_CHART 4
39 #define FL_PIE_CHART 5
40 #define FL_SPECIALPIE_CHART 6
42 #define FL_FILLED_CHART FL_FILL_CHART // compatibility
44 #define FL_CHART_MAX 128
45 #define FL_CHART_LABEL_MAX 18
47 struct FL_CHART_ENTRY {
50 char str[FL_CHART_LABEL_MAX+1];
53 class FL_EXPORT Fl_Chart : public Fl_Widget {
57 FL_CHART_ENTRY *entries;
60 uchar textfont_,textsize_;
65 Fl_Chart(int,int,int,int,const char * = 0);
68 void add(double, const char * =0, unsigned=0);
69 void insert(int, double, const char * =0, unsigned=0);
70 void replace(int, double, const char * =0, unsigned=0);
71 void bounds(double *a,double *b) const {*a = min; *b = max;}
72 void bounds(double a,double b);
73 int size() const {return numb;}
74 int maxsize() const {return maxnumb;}
76 Fl_Font textfont() const {return (Fl_Font)textfont_;}
77 void textfont(uchar s) {textfont_ = s;}
78 uchar textsize() const {return textsize_;}
79 void textsize(uchar s) {textsize_ = s;}
80 Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
81 void textcolor(unsigned n) {textcolor_ = n;}
82 uchar autosize() const {return autosize_;}
83 void autosize(uchar n) {autosize_ = n;}
89 // End of "$Id: Fl_Chart.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".