QwtBarCurve.h
Go to the documentation of this file.
/***************************************************************************
File : QwtBarCurve.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2006 by Ion Vasilief
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Bar curve
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef BARCURVE_H
#define BARCURVE_H
#include "PlotCurve.h"
#include <qwt_plot.h>
class QwtBarCurve: public DataCurve
{
public:
enum BarStyle{Vertical = 0, Horizontal = 1};
QwtBarCurve(BarStyle style, Table *t, const QString& xColName, const QString& name, int startRow, int endRow);
void copy(QwtBarCurve *b);
virtual QwtDoubleRect boundingRect() const;
BarStyle orientation(){return bar_style;};
void setGap (int gap);
int gap() const {return bar_gap;};
void setOffset(int offset);
int offset() const {return bar_offset;};
double dataOffset();
bool isStacked(){return d_is_stacked;};
void setStacked(bool on = true){d_is_stacked = on;};
virtual QString saveToString();
QList <QwtBarCurve *> stackedCurvesList() const;
double stackOffset(int i, QList <QwtBarCurve *> stack) const;
private:
virtual void draw(QPainter *painter,const QwtScaleMap &xMap,
const QwtScaleMap &yMap, int from, int to) const;
protected:
int bar_offset;
int bar_gap;
bool d_is_stacked;
BarStyle bar_style;
};
#endif
QwtBarCurve::dataOffset
double dataOffset()
Definition: QwtBarCurve.cpp:238
QwtBarCurve::gap
int gap() const
Definition: QwtBarCurve.h:49
QwtBarCurve::saveToString
virtual QString saveToString()
Definition: QwtBarCurve.cpp:272
QwtBarCurve::Vertical
Definition: QwtBarCurve.h:39
QwtBarCurve::d_is_stacked
bool d_is_stacked
Definition: QwtBarCurve.h:71
QwtBarCurve
Bar curve.
Definition: QwtBarCurve.h:36
QwtBarCurve::bar_style
BarStyle bar_style
Definition: QwtBarCurve.h:72
QwtBarCurve::bar_offset
int bar_offset
Definition: QwtBarCurve.h:69
DataCurve::endRow
int endRow()
Definition: PlotCurve.h:145
QwtBarCurve::bar_gap
int bar_gap
Definition: QwtBarCurve.h:70
PlotCurve.h
QwtBarCurve::stackOffset
double stackOffset(int i, QList< QwtBarCurve * > stack) const
Definition: QwtBarCurve.cpp:170
QwtBarCurve::offset
int offset() const
Definition: QwtBarCurve.h:52
QwtBarCurve::setGap
void setGap(int gap)
Definition: QwtBarCurve.cpp:222
QwtBarCurve::stackedCurvesList
QList< QwtBarCurve * > stackedCurvesList() const
Definition: QwtBarCurve.cpp:147
QwtBarCurve::boundingRect
virtual QwtDoubleRect boundingRect() const
Definition: QwtBarCurve.cpp:187
DataCurve
Definition: PlotCurve.h:96
QwtBarCurve::QwtBarCurve
QwtBarCurve(BarStyle style, Table *t, const QString &xColName, const QString &name, int startRow, int endRow)
Definition: QwtBarCurve.cpp:35
QwtBarCurve::orientation
BarStyle orientation()
Definition: QwtBarCurve.h:46
DataCurve::startRow
int startRow()
Definition: PlotCurve.h:144
QwtBarCurve::BarStyle
BarStyle
Definition: QwtBarCurve.h:39
QwtBarCurve::draw
virtual void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, int from, int to) const
Definition: QwtBarCurve.cpp:66
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
QwtBarCurve::setOffset
void setOffset(int offset)
Definition: QwtBarCurve.cpp:230
QwtBarCurve::copy
void copy(QwtBarCurve *b)
Definition: QwtBarCurve.cpp:58
QwtBarCurve::Horizontal
Definition: QwtBarCurve.h:39
QwtBarCurve::isStacked
bool isStacked()
Definition: QwtBarCurve.h:56
QwtBarCurve::setStacked
void setStacked(bool on=true)
Definition: QwtBarCurve.h:57