87dd7f0d23
git-svn-id: file:///fltk/svn/fltk/trunk@177 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
163 lines
4.3 KiB
HTML
163 lines
4.3 KiB
HTML
<html>
|
|
<body>
|
|
|
|
<hr break>
|
|
|
|
<h2><a name="Fl_Chart">class Fl_Chart</a></h2>
|
|
|
|
<hr>
|
|
|
|
<h3>Class Hierarchy</h3>
|
|
|
|
<ul><pre>
|
|
<a href="#Fl_Widget">Fl_Widget</a>
|
|
|
|
|
+----<b>Fl_Chart</b>
|
|
</pre></ul>
|
|
|
|
<h3>Include Files</h3>
|
|
|
|
<ul><pre>
|
|
#include <FL/Fl_Chart.H>
|
|
</pre></ul>
|
|
|
|
<h3>Description</h3>
|
|
|
|
This widget displays simple charts and is provided for forms compatibility.
|
|
|
|
<h3>Methods</h3>
|
|
|
|
<center>
|
|
<table width=90%>
|
|
<tr>
|
|
<td align=left valign=top>
|
|
<ul>
|
|
<li><a href="#Fl_Chart.Fl_Chart">Fl_Chart</a>
|
|
<li><a href="#Fl_Chart.~Fl_Chart">~Fl_Chart</a>
|
|
<li><a href="#Fl_Chart.add">add</a>
|
|
</ul>
|
|
</td>
|
|
<td align=left valign=top>
|
|
<ul>
|
|
<li><a href="#Fl_Chart.autosize">autosize</a>
|
|
<li><a href="#Fl_Chart.bounds">bounds</a>
|
|
</ul>
|
|
</td>
|
|
<td align=left valign=top>
|
|
<ul>
|
|
<li><a href="#Fl_Chart.clear">clear</a>
|
|
<li><a href="#Fl_Chart.insert">insert</a>
|
|
</ul>
|
|
</td>
|
|
<td align=left valign=top>
|
|
<ul>
|
|
<li><a href="#Fl_Chart.maxsize">maxsize</a>
|
|
<li><a href="#Fl_Chart.replace">replace</a>
|
|
</ul>
|
|
</td>
|
|
<td align=left valign=top>
|
|
<ul>
|
|
<li><a href="#Fl_Chart.size">size</a>
|
|
<li><a href="#Fl_Chart.type">type</a>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</center>
|
|
|
|
<h4><a name="Fl_Chart.Fl_Chart">Fl_Chart::Fl_Chart(int x, int y, int w, int h, const char *label = 0)</a></h4>
|
|
|
|
Creates a new <tt>Fl_Chart</tt> widget using the given position, size, and
|
|
label string. The default boxtype is <tt>FL_NO_BOX</tt>.
|
|
|
|
<h4><a name="Fl_Chart.~Fl_Chart">virtual Fl_Chart::~Fl_Chart()</a></h4>
|
|
|
|
Destroys the <tt>Fl_Chart</tt> widget and all of its data.
|
|
|
|
<h4><a name="Fl_Chart.add">void add(double value, const char *label = NULL, uchar color = 0)</a></h4>
|
|
|
|
The <tt>add</tt> method adds the <tt>value</tt> and optionally <tt>label</tt>
|
|
and <tt>color</tt> to the chart.
|
|
|
|
<h4><a name="Fl_Chart.autosize">uchar autosize(void) const<br>
|
|
void autosize(uchar onoff)</a></h4>
|
|
|
|
The <tt>autosize</tt> method controls whether or not the chart will
|
|
automatically adjust the bounds of the chart. The first form returns a
|
|
boolean value that is non-zero if auto-sizing is enabled and zero is auto-sizing
|
|
is disabled.
|
|
|
|
<p>The second form of <tt>autosize</tt> sets the auto-sizing property to
|
|
<tt>onoff</tt>.
|
|
|
|
<h4><a name="Fl_Chart.bounds">void bounds(double *a, double *b)<br>
|
|
void bounds(double a, double b)</a></h4>
|
|
|
|
The <tt>bounds</tt> method gets or sets the lower and upper bounds of the chart
|
|
values to <tt>a</tt> and <tt>b</tt> respectively.
|
|
|
|
<h4><a name="Fl_Chart.clear">void clear(void)</a></h4>
|
|
|
|
The <tt>clear</tt> method removes all values from the chart.
|
|
|
|
<h4><a name="Fl_Chart.insert">void insert(int pos, double value, const char *label = NULL, uchar color = 0)</a></h4>
|
|
|
|
The <tt>insert</tt> method inserts a data value at the given position
|
|
<tt>pos</tt>. Position 0 is the first data value.
|
|
|
|
<h4><a name="Fl_Chart.maxsize">int maxsize(void) const<br>
|
|
void maxsize(int n)</a></h4>
|
|
|
|
The <tt>maxsize</tt> method gets or sets the maximum number of data values for
|
|
a chart.
|
|
|
|
<h4><a name="Fl_Chart.replace">void replace(int pos, double value, const char *label = NULL, uchar color = 0)</a></h4>
|
|
|
|
The <tt>replace</tt> method replaces data value <tt>pos</tt> with
|
|
<tt>value</tt>, <tt>label</tt>, and <tt>color</tt>. Position 0 is
|
|
the first data value.
|
|
|
|
<h4><a name="Fl_Chart.size">int size(void) const</a></h4>
|
|
|
|
The <tt>size</tt> method returns the number of data values in the chart.
|
|
|
|
<h4><a name="Fl_Chart.type">uchar type() const<br>
|
|
void type(uchar t)</a></h4>
|
|
|
|
The first form of <tt>type()</tt> returns the current chart type.
|
|
The chart type can be one of the following:
|
|
|
|
<DL>
|
|
<DT>FL_BAR_CHART</DT>
|
|
<DD>Each sample value is drawn as a vertical bar.</DD>
|
|
|
|
<DT>FL_FILLED_CHART</DT>
|
|
<DD>The chart is filled from the bottom of the graph to the
|
|
sample values.</DD>
|
|
|
|
<DT>FL_HORBAR_CHART</DT>
|
|
<DD>Each sample value is drawn as a horizontal bar.</DD>
|
|
|
|
<DT>FL_LINE_CHART</DT>
|
|
<DD>The chart is drawn as a polyline with vertices at each
|
|
sample value.</DD>
|
|
|
|
<DT>FL_PIE_CHART</DT>
|
|
<DD>A pie chart is drawn with each sample value being drawn
|
|
as a proportionate slice in the circle.</DD>
|
|
|
|
<DT>FL_SPECIALPIE_CHART</DT>
|
|
<DD>Like FL_PIE_CHART, but the first slice is separated from
|
|
the pie.</DD>
|
|
|
|
<DT>FL_SPIKE_CHART</DT>
|
|
<DD>Each sample value is drawn as a vertical line.</DD>
|
|
</DL>
|
|
|
|
The second form of <tt>type()</tt> sets the chart type to <tt>t</tt>.
|
|
|
|
<center><img src="charts.gif" width=80%></center>
|
|
|
|
</body>
|
|
</html>
|