12#include "KDChartLineDiagram_p.h"
17#include "KDChartPainterSaver_p.h"
20#include <KDABLibFakes>
22#include "KDChartNormalLineDiagram_p.h"
23#include "KDChartPercentLineDiagram_p.h"
24#include "KDChartStackedLineDiagram_p.h"
28#include <QPainterPath>
35LineDiagram::Private::Private()
39LineDiagram::Private::~Private()
51void LineDiagram::init()
56 d->implementor =
d->normalDiagram;
57 d->centerDataPoints =
false;
58 d->reverseDatasetOrder =
false;
63 delete d->normalDiagram;
64 delete d->stackedDiagram;
65 delete d->percentDiagram;
97 if (
d->implementor->type() ==
type)
101 "This line chart type can't be used with multi-dimensional data.");
106 d->implementor =
d->normalDiagram;
109 d->implementor =
d->stackedDiagram;
112 d->implementor =
d->percentDiagram;
115 Q_ASSERT_X(
false,
"LineDiagram::setType",
"unknown diagram subtype");
133 return d->implementor->type();
138 if (
d->centerDataPoints == center) {
142 d->centerDataPoints = center;
153 return d->centerDataPoints;
163 return d->reverseDatasetOrder;
171 d->attributesModel->setModelData(
204 d->attributesModel->setData(
205 d->attributesModel->mapFromSource(index),
216 d->attributesModel->resetData(
246 return d->attributesModel->data(
247 d->attributesModel->mapFromSource(index),
259 d->attributesModel->setModelData(
285 d->attributesModel->setData(
286 d->attributesModel->mapFromSource(index),
316 return d->attributesModel->data(
317 d->attributesModel->mapFromSource(index),
338 d->attributesModel->setData(
d->attributesModel->mapFromSource(index),
350 return d->attributesModel->data(
351 d->attributesModel->mapFromSource(index),
387 return d->implementor->calculateDataBoundaries();
417 ctx->setCoordinatePlane(plane);
428#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && defined(Q_COMPILER_MANGLES_RETURN_TYPE)
437#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && defined(Q_COMPILER_MANGLES_RETURN_TYPE)
Base class for diagrams based on a cartesian coordianate system.
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane,...
virtual AbstractCoordinatePlane * sharedAxisMasterPlane(QPainter *p=nullptr)
virtual bool checkInvariants(bool justReturnTheStatus=false) const
void layoutChanged(AbstractDiagram *)
QModelIndex attributesModelRootIndex() const
returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the dia...
const QPair< QPointF, QPointF > dataBoundaries() const
Return the bottom left and top right data point, that the diagram will display (unless the grid adjus...
AbstractCoordinatePlane * coordinatePlane() const
void setDataBoundariesDirty() const
Q_DECL_DEPRECATED void setPercentMode(bool percent)
Deprecated method that turns the percent mode of this diagram on or off.
int datasetDimension() const
static bool isBoundariesValid(const QRectF &r)
virtual void paint(QPainter *)=0
Cartesian coordinate plane.
Set of attributes for changing the appearance of line charts.
LineDiagram defines a common line diagram.
void setType(const LineType type)
LineAttributes lineAttributes() const
void resizeEvent(QResizeEvent *) override
bool centerDataPoints() const
void setLineAttributes(const LineAttributes &a)
void setLineTension(qreal tenson)
LineDiagram(QWidget *parent=nullptr, CartesianCoordinatePlane *plane=nullptr)
int numberOfAbscissaSegments() const override
void paintEvent(QPaintEvent *) override
void setCenterDataPoints(bool center)
void setValueTrackerAttributes(const QModelIndex &index, const ValueTrackerAttributes &a)
qreal threeDItemDepth(const QModelIndex &index) const override
void setThreeDLineAttributes(const ThreeDLineAttributes &a)
qreal lineTension() const
virtual LineDiagram * clone() const
void resize(const QSizeF &area) override
ThreeDLineAttributes threeDLineAttributes() const
const QPair< QPointF, QPointF > calculateDataBoundaries() const override
void resetLineAttributes(int column)
void setReverseDatasetOrder(bool reverse)
void paint(PaintContext *paintContext) override
ValueTrackerAttributes valueTrackerAttributes(const QModelIndex &index) const
bool reverseDatasetOrder() const
int numberOfOrdinateSegments() const override
bool compare(const LineDiagram *other) const
Stores information about painting diagrams.
void setPainter(QPainter *painter)
A set of 3D line attributes.
Cell-specific attributes regarding value tracking.
@ ThreeDLineAttributesRole
@ ValueTrackerAttributesRole
QAbstractItemModel * model() const const
QModelIndex rootIndex() const const
T qobject_cast(QObject *object)
QVariant fromValue(const T &value)