Fl_Chart Class Reference

Fl_Chart displays simple charts. More...

#include <Fl_Chart.H>

Inheritance diagram for Fl_Chart:
Fl_Widget

List of all members.

Public Member Functions

void add (double val, const char *str=0, unsigned col=0)
 Add the data value val with optional label str and color col to the chart.
void autosize (uchar n)
 Set whether the chart will automatically adjust the bounds of the chart.
uchar autosize () const
 Get whether the chart will automatically adjust the bounds of the chart.
void bounds (double a, double b)
 Sets the lower and upper bounds of the chart values.
void bounds (double *a, double *b) const
 Gets the lower and upper bounds of the chart values.
void clear ()
 Removes all values from the chart.
 Fl_Chart (int X, int Y, int W, int H, const char *L=0)
 Create a new Fl_Chart widget using the given position, size and label string.
void insert (int ind, double val, const char *str=0, unsigned col=0)
 Inserts a data value val at the given position ind.
void maxsize (int m)
 Set the maximum number of data values for a chart.
int maxsize () const
 Gets the maximum number of data values for a chart.
void replace (int ind, double val, const char *str=0, unsigned col=0)
 Replace a data value val at the given position ind.
void size (int W, int H)
 Changes the size of the widget.
int size () const
 Returns the number of data values in the chart.
void textcolor (Fl_Color n)
 gets the chart's text color to n.
Fl_Color textcolor () const
 Gets the chart's text color.
void textfont (Fl_Font s)
 Sets the chart's text font to s.
Fl_Font textfont () const
 Gets the chart's text font.
void textsize (Fl_Fontsize s)
 gets the chart's text size to s.
Fl_Fontsize textsize () const
 Gets the chart's text size.
 ~Fl_Chart ()
 Destroys the Fl_Chart widget and all of its data.

Protected Member Functions

void draw ()
 Draws the widget.

Detailed Description

Fl_Chart displays simple charts.

It is provided for Forms compatibility.

charts.png
Todo:
Refactor Fl_Chart::type() information.

The type of an Fl_Chart object can be set using type(uchar t) to:


Constructor & Destructor Documentation

Fl_Chart::Fl_Chart ( int  X,
int  Y,
int  W,
int  H,
const char *  L = 0 
)

Create a new Fl_Chart widget using the given position, size and label string.

The default boxstyle is FL_NO_BOX.

Parameters:
[in] X,Y,W,H position and size of the widget
[in] L widget label, default is no label

Member Function Documentation

void Fl_Chart::add ( double  val,
const char *  str = 0,
unsigned  col = 0 
)

Add the data value val with optional label str and color col to the chart.

Parameters:
[in] val data value
[in] str optional data label
[in] col optional data color
void Fl_Chart::autosize ( uchar  n  )  [inline]

Set whether the chart will automatically adjust the bounds of the chart.

Parameters:
[in] n non-zero to enable automatic resizing, zero to disable.
uchar Fl_Chart::autosize (  )  const [inline]

Get whether the chart will automatically adjust the bounds of the chart.

Returns:
non-zero if auto-sizing is enabled and zero if disabled.
void Fl_Chart::bounds ( double  a,
double  b 
)

Sets the lower and upper bounds of the chart values.

Parameters:
[in] a,b are used to set lower, upper
void Fl_Chart::bounds ( double *  a,
double *  b 
) const [inline]

Gets the lower and upper bounds of the chart values.

Parameters:
[out] a,b are set to lower, upper
void Fl_Chart::draw (  )  [protected, virtual]

Draws the widget.

Never call this function directly. FLTK will schedule redrawing whenever needed. If your widget must be redrawn as soon as possible, call redraw() instead.

Override this function to draw your own widgets.

If you ever need to call another widget's draw method from within your own draw() method, e.g. for an embedded scrollbar, you can do it (because draw() is virtual) like this:

        Fl_Widget *s = &scroll;         // scroll is an embedded Fl_Scrollbar
        s->draw();                      // calls Fl_Scrollbar::draw()

Implements Fl_Widget.

void Fl_Chart::insert ( int  ind,
double  val,
const char *  str = 0,
unsigned  col = 0 
)

Inserts a data value val at the given position ind.

Position 1 is the first data value.

Parameters:
[in] ind insertion position
[in] val data value
[in] str optional data label
[in] col optional data color
void Fl_Chart::maxsize ( int  m  ) 

Set the maximum number of data values for a chart.

If you do not call this method then the chart will be allowed to grow to any size depending on available memory.

Parameters:
[in] m maximum number of data values allowed.
void Fl_Chart::replace ( int  ind,
double  val,
const char *  str = 0,
unsigned  col = 0 
)

Replace a data value val at the given position ind.

Position 1 is the first data value.

Parameters:
[in] ind insertion position
[in] val data value
[in] str optional data label
[in] col optional data color
void Fl_Chart::size ( int  W,
int  H 
) [inline]

Changes the size of the widget.

size(W, H) is a shortcut for resize(x(), y(), W, H).

Parameters:
[in] W,H new size
See also:
position(int,int), resize(int,int,int,int)

Reimplemented from Fl_Widget.

void Fl_Chart::textcolor ( Fl_Color  n  )  [inline]

gets the chart's text color to n.

void Fl_Chart::textfont ( Fl_Font  s  )  [inline]

Sets the chart's text font to s.

void Fl_Chart::textsize ( Fl_Fontsize  s  )  [inline]

gets the chart's text size to s.


The documentation for this class was generated from the following files: