Fl_Chart.H
//
// "$Id: Fl_Chart.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
//
// Forms chart header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2010 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
// http://www.fltk.org/COPYING.php
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
/* \file
Fl_Chart widget . */
#ifndef Fl_Chart_H
#define Fl_Chart_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
// values for type()
#define FL_BAR_CHART 0
#define FL_HORBAR_CHART 1
#define FL_LINE_CHART 2
#define FL_FILL_CHART 3
#define FL_SPIKE_CHART 4
#define FL_PIE_CHART 5
#define FL_SPECIALPIE_CHART 6
#define FL_FILLED_CHART FL_FILL_CHART
#define FL_CHART_MAX 128
#define FL_CHART_LABEL_MAX 18
struct FL_CHART_ENTRY {
float val;
unsigned col;
char str[FL_CHART_LABEL_MAX+1];
};
class FL_EXPORT Fl_Chart : public Fl_Widget {
int numb;
int maxnumb;
int sizenumb;
FL_CHART_ENTRY *entries;
double min,max;
uchar autosize_;
Fl_Font textfont_;
Fl_Fontsize textsize_;
Fl_Color textcolor_;
protected:
void draw();
public:
Fl_Chart(int X, int Y, int W, int H, const char *L = 0);
~Fl_Chart();
void clear();
void add(double val, const char *str = 0, unsigned col = 0);
void insert(int ind, double val, const char *str = 0, unsigned col = 0);
void replace(int ind, double val, const char *str = 0, unsigned col = 0);
void bounds(double *a,double *b) const {*a = min; *b = max;}
void bounds(double a,double b);
int size() const {return numb;}
void size(int W, int H) { Fl_Widget::size(W, H); }
int maxsize() const {return maxnumb;}
void maxsize(int m);
Fl_Font textfont() const {return textfont_;}
void textfont(Fl_Font s) {textfont_ = s;}
Fl_Fontsize textsize() const {return textsize_;}
void textsize(Fl_Fontsize s) {textsize_ = s;}
Fl_Color textcolor() const {return textcolor_;}
void textcolor(Fl_Color n) {textcolor_ = n;}
uchar autosize() const {return autosize_;}
void autosize(uchar n) {autosize_ = n;}
};
#endif
//
// End of "$Id: Fl_Chart.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
//
- © 1998-2012 by Bill Spitzak and others.