##// END OF EJS Templates
Color themes now enabled for scatter, pie and line series.
Color themes now enabled for scatter, pie and line series.

File last commit:

r75:cdad8ac737ab
r75:cdad8ac737ab
Show More
qpieseries.h
50 lines | 1.1 KiB | text/x-c | CLexer
#ifndef PIESERIES_H
#define PIESERIES_H
#include "qchartseries.h"
#include <QObject>
#include <QRectF>
#include <QColor>
class QGraphicsObject;
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class PieSlice;
class QTCOMMERCIALCHART_EXPORT QPieSeries : public QChartSeries
{
Q_OBJECT
public:
// TODO: use a generic data class instead of x and y
QPieSeries(QGraphicsObject *parent = 0);
~QPieSeries();
void setSizeFactor(qreal sizeFactor);
qreal sizeFactor() { return m_sizeFactor; }
public: // from QChartSeries
QChartSeriesType type() const { return QChartSeries::SeriesTypePie; }
bool setData(QList<qreal> data);
public:
void setSliceColor(int index, QColor color);
QColor sliceColor(int index);
int sliceCount();
public Q_SLOTS:
void chartSizeChanged(QRectF rect);
private:
void resizeSlices(QRectF rect);
//Q_DECLARE_PRIVATE(QPieSeries)
Q_DISABLE_COPY(QPieSeries)
friend class QChart;
// TODO: move the followin to internal impl
QList<qreal> m_data;
QList<PieSlice*> m_slices;
QRectF m_chartSize;
qreal m_sizeFactor;
};
QTCOMMERCIALCHART_END_NAMESPACE
#endif // PIESERIES_H