12#include "KDChartRingDiagram_p.h"
17#include "KDChartPainterSaver_p.h"
19#include "KDChartPolarCoordinatePlane_p.h"
24#include <KDABLibFakes>
28RingDiagram::Private::Private()
32RingDiagram::Private::~Private()
48void RingDiagram::init()
80 return d->relativeThickness;
85 d->expandWhenExploded = expand;
90 return d->expandWhenExploded;
103 if (
attrs.explode()) {
116 if (!
d->expandWhenExploded) {
149 d->reverseMapper.clear();
178 if (!
d->expandWhenExploded) {
201 d->forgetAlreadyPaintedDataValues();
235#define trunc(x) (( int )(x))
243void RingDiagram::drawOneSlice(
QPainter *painter, uint dataset, uint slice, qreal granularity)
263void RingDiagram::drawPieSurface(
QPainter *painter, uint dataset, uint slice, qreal granularity)
300 if (
attrs.gapFactor(
true) > 0.0) {
322 if (
d->expandWhenExploded) {
327 if (
cellAttrs.explode() &&
d->expandWhenExploded) {
385 d->reverseMapper.addPolygon(index.row(), index.column(),
poly);
394 const QLineF line(p1, p2);
396 const qreal angle = line.dx() == 0 ? 0.0 :
atan(line.dy() / line.dx());
398 painter->
rotate(angle / 2.0 / 3.141592653589793 * 360.0);
411QPointF RingDiagram::pointOnEllipse(
const QRectF &rect,
int dataset,
int slice,
bool outer, qreal angle,
412 qreal totalGapFactor, qreal totalExplodeFactor)
Declaring the class KDChart::DataValueAttributes.
virtual bool checkInvariants(bool justReturnTheStatus=false) const
DataValueAttributes dataValueAttributes() const
void paintDataValueText(QPainter *painter, const QModelIndex &index, const QPointF &pos, qreal value)
Base class for any diagram type.
PieAttributes pieAttributes() const
qreal granularity() const
bool autoRotateLabels() const
ThreeDPieAttributes threeDPieAttributes() const
const PolarCoordinatePlane * polarCoordinatePlane() const
TextAttributes textAttributes() const
Stores information about painting diagrams.
void setPainter(QPainter *painter)
A set of attributes controlling the appearance of pie charts.
qreal startPosition() const
RingDiagram defines a common ring diagram.
bool relativeThickness() const
void setRelativeThickness(bool relativeThickness)
void paint(PaintContext *paintContext) override
void resize(const QSizeF &area) override
qreal numberOfGridRings() const override
qreal valueTotals() const override
void paintEvent(QPaintEvent *) override
qreal numberOfDatasets() const override
bool compare(const RingDiagram *other) const
qreal numberOfValuesPerDataset() const override
const QPair< QPointF, QPointF > calculateDataBoundaries() const override
virtual void setExpandWhenExploded(bool expand)
virtual bool expandWhenExploded() const
virtual RingDiagram * clone() const
RingDiagram(QWidget *parent=nullptr, PolarCoordinatePlane *plane=nullptr)
void resizeEvent(QResizeEvent *) override
A set of text attributes.
A set of 3D pie attributes.
virtual int columnCount(const QModelIndex &parent) const const=0
virtual int rowCount(const QModelIndex &parent) const const=0
QAbstractItemModel * model() const const
QModelIndex rootIndex() const const
T qobject_cast(QObject *object)
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule)
void setBrush(const QBrush &brush)
void setPen(const QColor &color)
void setRenderHint(QPainter::RenderHint hint, bool on)
void translate(const QPointF &offset)
bool isEmpty() const const
QRect contentsRect() const const