3
<TITLE>Source: tolinechart.h</TITLE>
5
<META NAME="Generator" CONTENT="KDOC ">
7
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
8
<TABLE WIDTH="100%" BORDER="0">
12
<TR><TD valign="top" align="left" cellspacing="10">
13
<h1>Source: tolinechart.h</h1>
15
<TD valign="top" align="right" colspan="1"></TD></TR>
22
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
23
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
24
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
25
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
26
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
27
</TABLE></TD></TR></TABLE>
31
* TOra - An Oracle Toolkit for DBA's and developers
32
* Copyright (C) 2003-2005 Quest Software, Inc
33
* Portions Copyright (C) 2005 Other Contributors
35
* This program is free software; you can redistribute it and/or
36
* modify it under the terms of the GNU General Public License
37
* as published by the Free Software Foundation; only version 2 of
38
* the License is valid for this program.
40
* This program is distributed in the hope that it will be useful,
41
* but WITHOUT ANY WARRANTY; without even the implied warranty of
42
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43
* GNU General Public License for more details.
45
* You should have received a copy of the GNU General Public License
46
* along with this program; if not, write to the Free Software
47
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
49
* As a special exception, you have permission to link this program
50
* with the Oracle Client libraries and distribute executables, as long
51
* as you follow the requirements of the GNU GPL in regard to all of the
52
* software in the executable aside from Oracle client libraries.
54
* Specifically you are not permitted to link this program with the
55
* Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
56
* And you are not permitted to distribute binaries compiled against
57
* these libraries without written consent from Quest Software, Inc.
58
* Observe that this does not disallow linking to the Qt Free Edition.
60
* You may link this product with any GPL'd Qt library such as Qt/Free
62
* All trademarks belong to their respective owners.
77
/** A widget that displays a linechart with optional background throbber (Not implemented yet).
80
class toLineChart : public QWidget {
85
QScrollBar *Horizontal;
89
std::list<std::list<double> > Values;
90
std::list<QString> XValues;
91
std::list<QString> Labels;
92
std::list<bool> Enabled;
106
QPoint MousePoint[2];
114
static double round(double round,bool up);
115
QRect fixRect(QPoint p1,QPoint p2);
116
virtual void mouseReleaseEvent(QMouseEvent *e);
117
virtual void mouseMoveEvent(QMouseEvent *e);
118
virtual void mouseDoubleClickEvent(QMouseEvent *e);
119
virtual void mousePressEvent(QMouseEvent *e);
121
int countSamples(void);
122
void clearZoom(void);
124
virtual void paintLegend(QPainter *p,QRect &rect);
125
virtual void paintTitle(QPainter *p,QRect &rect);
126
virtual void paintAxis(QPainter *p,QRect &rect);
127
virtual void paintChart(QPainter *p,QRect &rect);
129
/** Create a new linechart.
130
* @param parent Parent widget.
131
* @param name Name of widget.
132
* @param f Widget flags.
134
toLineChart(QWidget *parent=NULL,const char *name=NULL,WFlags f=0);
136
/** Create a new chart by copying all the data from another chart.
137
* @param chart Chart to copy data from.
138
* @param parent Parent widget.
139
* @param name Name of widget.
140
* @param f Widget flags.
142
toLineChart(toLineChart *chart,QWidget *parent=NULL,const char *name=NULL,WFlags f=0);
148
/** Specify if legend should be displayed to the right of the graph, default is on.
149
* @param on Whether to display legend or not.
151
void showLegend(bool on)
152
{ Legend=on; update(); }
153
/** Check if legend is displayed or not.
154
* @return If legend is displayed or not.
156
bool legend(void) const
159
/** Show most recent value on top of graph
160
* @param on Whether to display or not.
162
void showLast(bool on)
163
{ Last=on; update(); }
164
/** Check if last value is displayed or not.
165
* @return If value is displayed or not.
167
bool last(void) const
170
/** Set title of the chart. Set to empty string to not display title.
171
* @param title Title of chart.
173
void setTitle(const QString &title=QString::null)
174
{ Title=title; setCaption(title); update(); }
175
/** Get title of chart.
176
* @return Title of chart.
178
const QString &title(void)
181
/** Specify if a grid should be displayed in the graph, default is on.
182
* @param div Number of parts to divide grid into.
184
void showGrid(int div=0)
185
{ Grid=div; update(); }
186
/** Check if grid is displayed or not.
187
* @return Number of parts to divide grid into.
192
/** Specify if a y-axis legend should be displayed in the graph, default is on.
193
* @param on Whether to display legend or not.
195
void showAxisLegend(bool on)
196
{ AxisText=on; update(); }
197
/** Check if y-axis legend is displayed or not.
198
* @return If legend is displayed or not.
200
bool axisLegend(void) const
203
/** Set y postfix value. This will be appended to the values in the axis legend.
204
* @param postfix The string to append.
206
void setYPostfix(const QString &postfix)
207
{ YPostfix=postfix; update(); }
208
/** Set max value on y-axis to auto.
210
void setMaxValueAuto(void)
211
{ MaxAuto=true; update(); }
212
/** Set min value on y-axis to auto.
214
void setMinValueAuto(void)
215
{ MinAuto=true; update(); }
216
/** Set max value on y-axis.
217
* @param val Max value on y-axis.
219
void setMaxValue(double maxVal)
220
{ MaxAuto=false; MaxValue=maxVal; update(); }
221
/** Set min value on y-axis.
222
* @param val Min value on y-axis.
224
void setMinValue(double minVal)
225
{ MinAuto=false; MinValue=minVal; update(); }
226
/** Get minimum value on y-axis. Will not return the automatically determinned minimum value.
227
* @return Minimum value on y-axis.
229
double minValue(void) const
231
/** Get maximum value on y-axis. Will not return the automatically determinned maximum value.
232
* @return Maximum value on y-axis.
234
double maxValue(void) const
237
/** Set the number of samples on the x-axis. Setting samples to -1 will keep all entries.
238
* @param samples Number of samples.
240
void setSamples(int samples=-1);
241
/** Get the maximum number of samples on the x-axis.
242
* @return Max number of samples.
244
int samples(void) const
247
/** Set the labels on the chart lines.
248
* @param labels Labels of the lines. Empty labels will not show up in the legend.
250
void setLabels(const std::list<QString> &labels)
251
{ Labels=labels; update(); }
252
/** Get the labels of the chart lines.
253
* @return List of labels.
255
std::list<QString> &labels(void)
258
/** Add a new value set to the chart.
259
* @param value New values for charts (One for each line).
260
* @param label X-value on these values.
262
virtual void addValues(std::list<double> &value,const QString &xValues);
264
/** Get list of labels
265
* @return List of labels
267
std::list<QString> &xValues(void)
270
/** Get list of values.
271
* @return Values in piechart.
273
std::list<std::list<double> > &values(void)
276
/** Export chart to a map.
277
* @param data A map that can be used to recreate the data of a chart.
278
* @param prefix Prefix to add to the map.
280
virtual void exportData(std::map<QCString,QString> &data,const QCString &prefix);
282
* @param data Data to read from a map.
283
* @param prefix Prefix to read data from.
285
virtual void importData(std::map<QCString,QString> &data,const QCString &prefix);
287
/** Get enabled datavalues. Values in this list with false are not drawn in the chart.
288
* Could be an empty list if everything is enabled.
290
std::list<bool> enabledCharts(void)
292
/** Set enabled datavalues. Values in this list with false are not drawn in the chart.
294
void setEnabledCharts(std::list<bool> &enabled)
295
{ Enabled=enabled; update(); }
296
/** Open chart in new window.
298
virtual toLineChart *openCopy(QWidget *parent);
300
/** A new value set was added to the chart.
301
* @param value New values for charts (One for each line).
302
* @param label X-value on these values.
304
virtual void valueAdded(std::list<double> &value,const QString &xValues);
306
/** Clear the values from the chart.
308
virtual void clear(void)
309
{ Values.clear(); XValues.clear(); update(); }
311
/** Setup values of charts.
313
virtual void setup(void);
317
virtual void editPrint(void);
322
/** Reimplemented for internal reasons.
324
virtual void paintEvent(QPaintEvent *e);
325
/** Reimplemented for internal reasons.
327
virtual void addMenues(QPopupMenu *)
330
void horizontalChange(int);
331
void verticalChange(int);
332
void chartSetup(void);
339
<tr><td><small>Generated by: nneul on skyhawk on Wed Feb 23 19:49:58 2005, using kdoc 2.0a54.</small></td></tr>