12#include "KDChartPlotter_p.h"
15#include "KDChartPainterSaver_p.h"
17#include <KDABLibFakes>
19#include "KDChartNormalPlotter_p.h"
20#include "KDChartPercentPlotter_p.h"
24Plotter::Private::Private()
28Plotter::Private::~Private()
31 delete percentPlotter;
47 d->implementor =
d->normalPlotter;
48 Private *
test =
d->implementor->plotterPrivate();
92 d->plotterCompressor.setModel(
nullptr);
95 d->compressor.setModel(
nullptr);
112 return d->implementor->useCompression();
118 d->implementor->setUseCompression(value);
120 d->compressor.setModel(
nullptr);
129 return d->plotterCompressor.maxSlopeChange();
134 d->plotterCompressor.setMaxSlopeChange(value);
139 return d->mergeRadiusPercentage;
144 if (
d->mergeRadiusPercentage != value) {
145 d->mergeRadiusPercentage = value;
156 if (
d->implementor->type() ==
type) {
161 "This line chart type can only be used with two-dimensional data.");
166 d->implementor =
d->normalPlotter;
169 d->implementor =
d->percentPlotter;
172 Q_ASSERT_X(
false,
"Plotter::setType",
"unknown plotter subtype");
175 d->implementor->plotterPrivate(), &KDChart::Plotter::Private::changedProperties);
192 return d->implementor->type();
227 d->attributesModel->setData(
d->attributesModel->mapFromSource(index),
237 d->attributesModel->resetData(
266 return d->attributesModel->data(
316 if (
attrs.isValid()) {
327 return d->attributesModel->data(
347 d->attributesModel->setData(
d->attributesModel->mapFromSource(index),
357 return d->attributesModel->data(
376 return d->implementor->calculateDataBoundaries();
398 d->setCompressorResolution(
size(), plane);
410 d->implementor->paint(
ctx);
412 ctx->setCoordinatePlane(plane);
419 d->plotterCompressor.cleanCache();
440 QRectF range = plane->visibleDataRange();
442 const qreal radius = std::sqrt((range.
x() + range.
width()) * (range.
y() + range.
height()));
446 d->plotterCompressor.setMergeRadius(radius *
d->mergeRadiusPercentage);
449#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && defined(Q_COMPILER_MANGLES_RETURN_TYPE)
458#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.
void connectAttributesModel(AttributesModel *)
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane,...
virtual AbstractCoordinatePlane * sharedAxisMasterPlane(QPainter *p=nullptr)
void internal_geometryChanged(QRect, QRect)
void geometryChanged(QRect, QRect)
virtual AttributesModel * attributesModel() const
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
int datasetDimension() const
void attributesModelAboutToChange(AttributesModel *newModel, AttributesModel *oldModel)
void setDatasetDimensionInternal(int dimension)
static bool isBoundariesValid(const QRectF &r)
A proxy model used for decorating data with attributes.
Cartesian coordinate plane.
Set of attributes for changing the appearance of line charts.
Stores information about painting diagrams.
void setPainter(QPainter *painter)
Plotter defines a diagram type plotting two-dimensional data.
bool compare(const Plotter *other) const
void paintEvent(QPaintEvent *) override
void setType(const PlotType type)
int numberOfAbscissaSegments() const override
void resizeEvent(QResizeEvent *) override
Plotter(QWidget *parent=nullptr, CartesianCoordinatePlane *plane=nullptr)
void resize(const QSizeF &area) override
virtual Plotter * clone() const
ThreeDLineAttributes threeDLineAttributes() const
void paint(PaintContext *paintContext) override
void setLineAttributes(const LineAttributes &a)
void resetLineAttributes(int column)
void setThreeDLineAttributes(const ThreeDLineAttributes &a)
void setMaxSlopeChange(qreal value)
LineAttributes lineAttributes() const
void setUseDataCompression(CompressionMode value)
void setDataBoundariesDirty()
qreal maxSlopeChange() const
CompressionMode useDataCompression
const QPair< QPointF, QPointF > calculateDataBoundaries() const override
void setMergeRadiusPercentage(qreal value)
qreal mergeRadiusPercentage
int numberOfOrdinateSegments() const override
void connectAttributesModel(AttributesModel *)
qreal threeDItemDepth(const QModelIndex &index) const override
ValueTrackerAttributes valueTrackerAttributes(const QModelIndex &index) const
void setValueTrackerAttributes(const QModelIndex &index, const ValueTrackerAttributes &a)
A set of 3D line attributes.
Cell-specific attributes regarding value tracking.
@ ThreeDLineAttributesRole
@ ValueTrackerAttributesRole
QAbstractItemModel * model() const const
QModelIndex rootIndex() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
T qobject_cast(QObject *object)
qreal height() const const
qreal width() const const
QVariant fromValue(const T &value)