##// END OF EJS Templates
Refactored themes; now enabled for line, scatter and pies...
Refactored themes; now enabled for line, scatter and pies Draft themes implemented for most of the series types. The themes are still missing most of the features, only the line color and line width can be defined.

File last commit:

r103:399cbfcd557c
r103:399cbfcd557c
Show More
stackedbargroup.h
58 lines | 1.5 KiB | text/x-c | CLexer
sauimone
added missing example files :)
r96 #ifndef STACKEDBARGROUP_H
#define STACKEDBARGROUP_H
Tero Ahola
Refactored themes; now enabled for line, scatter and pies...
r103 #include "chartitemcontrol.h"
sauimone
added missing example files :)
r96 #include "bar.h"
#include "stackedbarchartseries.h"
Tero Ahola
Refactored themes; now enabled for line, scatter and pies...
r103 #include <QGraphicsItem>
sauimone
added missing example files :)
r96
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Tero Ahola
Refactored themes; now enabled for line, scatter and pies...
r103 class StackedBarGroup : public QGraphicsItem, public ChartItemControl
sauimone
added missing example files :)
r96 {
public:
StackedBarGroup(StackedBarChartSeries& series, QGraphicsItem *parent = 0);
Tero Ahola
Refactored themes; now enabled for line, scatter and pies...
r103 public: // From ChartItemControl
void setPos(const QPointF & pos);
void resize(const QSize &size);
void setTheme(ChartTheme *theme);
void setPlotDomain(const PlotDomain& data);
sauimone
added missing example files :)
r96
Tero Ahola
Refactored themes; now enabled for line, scatter and pies...
r103 public: // Layout "api"
sauimone
added missing example files :)
r96 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
StackedBarChartSeries& 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
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif // STACKEDBARGROUP_H