##// END OF EJS Templates
tuning theme colors
tuning theme colors

File last commit:

r118:4d1d9ed7ae03
r125:d693628c68fb
Show More
bargroup.h
57 lines | 1.4 KiB | text/x-c | CLexer
#ifndef QBARGROUP_H
#define QBARGROUP_H
#include "chartitem_p.h"
#include "bar_p.h"
#include "barchartseries.h"
#include <QGraphicsItem>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class BarGroup : public ChartItem
{
public:
explicit BarGroup(BarChartSeries& series, QGraphicsItem *parent = 0);
public: // from ChartItem
void setSize(const QSizeF &size);
void setPlotDomain(const PlotDomain& data);
// Layout "api"
void setPos(qreal x, qreal y);
void setBarWidth( int w ); // Default width for each bar
int addColor( QColor color );
void resetColors();
// From QGraphicsItem
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QRectF boundingRect() const;
private:
void dataChanged(); // data of series has changed -> need to recalculate bar sizes
void layoutChanged(); // layout has changed -> need to recalculate bar sizes
private:
// Data
BarChartSeries& mSeries;
int mMin; // Min and max values of data. (updated when data is changed, used when drawing)
int mMax;
int mHeight; // Layout spesific
int mWidth;
int mBarDefaultWidth;
bool mLayoutSet; // True, if component has been laid out.
bool mLayoutDirty;
QList<QColor> mColors; // List of colors for series for now
PlotDomain mPlotDomain;
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif // QBARGROUP_H