KChart

KChartAbstractDiagram.h
1/*
2 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 *
4 * This file is part of the KD Chart library.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KCHARTABSTRACTDIAGRAM_H
10#define KCHARTABSTRACTDIAGRAM_H
11
12#include <QList>
13#include <QRectF>
14#include <QAbstractItemView>
15
16#include "KChartGlobal.h"
17#include "KChartMarkerAttributes.h"
18#include "KChartAttributesModel.h"
19
20namespace KChart {
21
22 class AbstractCoordinatePlane;
23 class AttributesModel;
24 class DataValueAttributes;
25 class PaintContext;
26
27 /**
28 * @brief AbstractDiagram defines the interface for diagram classes
29 *
30 * AbstractDiagram is the base class for diagram classes ("chart types").
31 *
32 * It defines the interface, that needs to be implemented for the diagram,
33 * to function within the KChart framework. It extends Interview's
34 * QAbstractItemView.
35 */
36 class KCHART_EXPORT AbstractDiagram : public QAbstractItemView
37 {
38 Q_OBJECT
39 Q_DISABLE_COPY( AbstractDiagram )
40 KCHART_DECLARE_PRIVATE_BASE_POLYMORPHIC( AbstractDiagram )
41
42 friend class AbstractCoordinatePlane;
43 friend class CartesianCoordinatePlane;
44 friend class PolarCoordinatePlane;
45
46 protected:
47 explicit inline AbstractDiagram(
48 Private *p, QWidget* parent, AbstractCoordinatePlane* plane );
49 explicit AbstractDiagram (
50 QWidget* parent = nullptr, AbstractCoordinatePlane* plane = nullptr );
51 public:
52 ~AbstractDiagram() override;
53
54
55 /**
56 * Returns true if both diagrams have the same settings.
57 */
58 bool compare( const AbstractDiagram* other ) const;
59
60
61 /**
62 * @brief Return the bottom left and top right data point, that the
63 * diagram will display (unless the grid adjusts these values).
64 *
65 * This method returns a cached result of calculations done by
66 * calculateDataBoundaries.
67 * Classes derived from AbstractDiagram must implement the
68 * calculateDataBoundaries function, to specify their own
69 * way of calculating the data boundaries.
70 * If derived classes want to force recalculation of the
71 * data boundaries, they can call setDataBoundariesDirty()
72 *
73 * Returned value is in diagram coordinates.
74 */
75 const QPair<QPointF, QPointF> dataBoundaries() const;
76
77 // protected: // FIXME: why should that be private? (Mirko)
78 /**
79 * Draw the diagram contents to the rectangle and painter, that are
80 * passed in as part of the paint context.
81 *
82 * @param paintContext All information needed for painting.
83 */
84 virtual void paint ( PaintContext* paintContext ) = 0;
85
86 /**
87 * Called by the widget's sizeEvent. Adjust all internal structures,
88 * that are calculated, dependending on the size of the widget.
89 *
90 * @param area
91 */
92 virtual void resize ( const QSizeF& area );
93
94 /** Associate a model with the diagram. */
95 void setModel ( QAbstractItemModel * model ) override;
96
97 /** Associate a seleection model with the diagrom. */
98 void setSelectionModel( QItemSelectionModel* selectionModel ) override;
99
100 /**
101 * Associate an AttributesModel with this diagram. Note that
102 * the diagram does _not_ take ownership of the AttributesModel.
103 * This should thus only be used with AttributesModels that
104 * have been explicitly created by the user, and are owned
105 * by her. Setting an AttributesModel that is internal to
106 * another diagram is an error.
107 *
108 * Correct:
109 *
110 * \code
111 * AttributesModel *am = new AttributesModel( model, 0 );
112 * diagram1->setAttributesModel( am );
113 * diagram2->setAttributesModel( am );
114 *
115 * \endcode
116 *
117 * Wrong:
118 *
119 * \code
120 *
121 * diagram1->setAttributesModel( diagram2->attributesModel() );
122 *
123 * \endcode
124 *
125 * @param model The AttributesModel to use for this diagram.
126 * @see AttributesModel, usesExternalAttributesModel
127 */
128 virtual void setAttributesModel( AttributesModel* model );
129
130 /**
131 * Returns whether the diagram is using its own built-in attributes model
132 * or an attributes model that was set via setAttributesModel.
133 *
134 * @see setAttributesModel
135 */
136 virtual bool usesExternalAttributesModel() const;
137
138 /**
139 * Returns the AttributesModel, that is used by this diagram.
140 * By default each diagram owns its own AttributesModel, which
141 * should never be deleted. Only if a user-supplied AttributesModel
142 * has been set does the pointer returned here not belong to the
143 * diagram.
144 *
145 * @return The AttributesModel associated with the diagram.
146 * @see setAttributesModel
147 */
148 virtual AttributesModel* attributesModel() const;
149
150 /** Set the root index in the model, where the diagram starts
151 * referencing data for display. */
152 void setRootIndex ( const QModelIndex& idx ) override;
153
154 /** \reimpl */
155 QRect visualRect(const QModelIndex &index) const override;
156 /** \reimpl */
157 void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
158 /** \reimpl */
159 QModelIndex indexAt(const QPoint &point) const override;
160 /** \reimpl */
161 QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
162 /** \reimpl */
163 int horizontalOffset() const override;
164 /** \reimpl */
165 int verticalOffset() const override;
166 /** \reimpl */
167 bool isIndexHidden(const QModelIndex &index) const override;
168 /** \reimpl */
169 void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override;
170 /** \reimpl */
171 QRegion visualRegionForSelection(const QItemSelection &selection) const override;
172 virtual QRegion visualRegion(const QModelIndex &index) const;
173 /** \reimpl */
174 void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) override;
175 /** \reimpl */
176 void doItemsLayout() override;
177
178 /**
179 * The coordinate plane associated with the diagram. This determines
180 * how coordinates in value space are mapped into pixel space. By default
181 * this is a CartesianCoordinatePlane.
182 * @return The coordinate plane associated with the diagram.
183 */
184 AbstractCoordinatePlane* coordinatePlane() const;
185
186 /**
187 * Set the coordinate plane associated with the diagram. This determines
188 * how coordinates in value space are mapped into pixel space. The chart
189 * takes ownership.
190 */
191 virtual void setCoordinatePlane( AbstractCoordinatePlane* plane );
192
193
194 /**
195 * Hide (or unhide, resp.) a data cell.
196 *
197 * \note Hidden data are still taken into account by the coordinate plane,
198 * so neither the grid nor your axes' ranges will change, when you hide data.
199 * For totally removing data from KChart's view you can use another approach:
200 * e.g. you could define a proxy model on top of your data model, and register
201 * the proxy model calling setModel() instead of registering your real data model.
202 *
203 * @param index The datapoint to set the hidden status for. With a dataset dimension
204 * of two, this is the index of the key of each key/value pair.
205 * @param hidden The hidden status to set.
206 */
207 void setHidden( const QModelIndex & index, bool hidden );
208
209 /**
210 * Hide (or unhide, resp.) a dataset.
211 *
212 * \note Hidden data are still taken into account by the coordinate plane,
213 * so neither the grid nor your axes' ranges will change, when you hide data.
214 * For totally removing data from KChart's view you can use another approach:
215 * e.g. you could define a proxy model on top of your data model, and register
216 * the proxy model calling setModel() instead of registering your real data model.
217 *
218 * @param dataset The dataset to set the hidden status for.
219 * @param hidden The hidden status to set.
220 */
221 void setHidden( int dataset, bool hidden );
222
223 /**
224 * Hide (or unhide, resp.) all datapoints in the model.
225 *
226 * \note Hidden data are still taken into account by the coordinate plane,
227 * so neither the grid nor your axes' ranges will change, when you hide data.
228 * For totally removing data from KChart's view you can use another approach:
229 * e.g. you could define a proxy model on top of your data model, and register
230 * the proxy model calling setModel() instead of registering your real data model.
231 *
232 * @param hidden The hidden status to set.
233 */
234 void setHidden( bool hidden );
235
236 /**
237 * Retrieve the hidden status specified globally. This will fall
238 * back automatically to the default settings ( = not hidden), if there
239 * are no specific settings.
240 * @return The global hidden status.
241 */
242 bool isHidden() const;
243
244 /**
245 * Retrieve the hidden status for the given dataset. This will fall
246 * back automatically to what was set at diagram level, if there
247 * are no dataset specific settings.
248 * @param dataset The dataset to retrieve the hidden status for.
249 * @return The hidden status for the given dataset.
250 */
251 bool isHidden( int dataset ) const;
252
253 /**
254 * Retrieve the hidden status for the given index. This will fall
255 * back automatically to what was set at dataset or diagram level, if there
256 * are no datapoint specific settings.
257 * @param index The datapoint to retrieve the hidden status for.
258 * @return The hidden status for the given index.
259 */
260 bool isHidden( const QModelIndex & index ) const;
261
262
263 /**
264 * Set the DataValueAttributes for the given index.
265 * @param index The datapoint to set the attributes for. With a dataset dimension
266 * of two, this is the index of the key of each key/value pair.
267 * @param a The attributes to set.
268 */
269 void setDataValueAttributes( const QModelIndex & index,
270 const DataValueAttributes & a );
271
272 /**
273 * Set the DataValueAttributes for the given dataset.
274 * @param dataset The dataset to set the attributes for.
275 * @param a The attributes to set.
276 */
277 void setDataValueAttributes( int dataset, const DataValueAttributes & a );
278
279 /**
280 * Set the DataValueAttributes for all datapoints in the model.
281 * @param a The attributes to set.
282 */
283 void setDataValueAttributes( const DataValueAttributes & a );
284
285 /**
286 * Retrieve the DataValueAttributes specified globally. This will fall
287 * back automatically to the default settings, if there
288 * are no specific settings.
289 * @return The global DataValueAttributes.
290 */
291 DataValueAttributes dataValueAttributes() const;
292
293 /**
294 * Retrieve the DataValueAttributes for the given dataset. This will fall
295 * back automatically to what was set at model level, if there
296 * are no dataset specific settings.
297 * @param dataset The dataset to retrieve the attributes for.
298 * @return The DataValueAttributes for the given dataset.
299 */
300 DataValueAttributes dataValueAttributes( int dataset ) const;
301
302 /**
303 * Retrieve the DataValueAttributes for the given index. This will fall
304 * back automatically to what was set at dataset or model level, if there
305 * are no datapoint specific settings.
306 * @param index The datapoint to retrieve the attributes for. With a dataset dimension
307 * of two, this is the index of the key of each key/value pair.
308 * @return The DataValueAttributes for the given index.
309 */
310 DataValueAttributes dataValueAttributes( const QModelIndex & index ) const;
311
312 /**
313 * Set the pen to be used, for painting the datapoint at the given index.
314 * @param index The datapoint's index in the model. With a dataset dimension
315 * of two, this is the index of the key of each key/value pair.
316 * @param pen The pen to use.
317 */
318 void setPen( const QModelIndex& index, const QPen& pen );
319
320 /**
321 * Set the pen to be used, for painting the given dataset.
322 * @param dataset The dataset to set the pen for.
323 * @param pen The pen to use.
324 */
325 void setPen( int dataset, const QPen& pen );
326
327 /**
328 * Set the pen to be used, for painting all datasets in the model.
329 * @param pen The pen to use.
330 */
331 void setPen( const QPen& pen );
332
333 /**
334 * Retrieve the pen to be used for painting datapoints globally. This will fall
335 * back automatically to the default settings, if there
336 * are no specific settings.
337 * @return The pen to use for painting.
338 */
339 QPen pen() const;
340 /**
341 * Retrieve the pen to be used for the given dataset. This will fall
342 * back automatically to what was set at model level, if there
343 * are no dataset specific settings.
344 * @param dataset The dataset to retrieve the pen for.
345 * @return The pen to use for painting.
346 */
347 QPen pen( int dataset ) const;
348 /**
349 * Retrieve the pen to be used, for painting the datapoint at the given
350 * index in the model.
351 * @param index The index of the datapoint in the model. With a dataset dimension
352 * of two, this is the index of the key of each key/value pair.
353 * @return The pen to use for painting.
354 */
355 QPen pen( const QModelIndex& index ) const;
356
357 /**
358 * Set the brush to be used, for painting the datapoint at the given index.
359 * @param index The datapoint's index in the model. With a dataset dimension
360 * of two, this is the index of the key of each key/value pair.
361 * @param brush The brush to use.
362 */
363 void setBrush( const QModelIndex& index, const QBrush& brush);
364
365 /**
366 * Set the brush to be used, for painting the given dataset.
367 * @param dataset The dataset to set the brush for.
368 * @param brush The brush to use.
369 */
370 void setBrush( int dataset, const QBrush& brush );
371
372 /**
373 * Set the brush to be used, for painting all datasets in the model.
374 * @param brush The brush to use.
375 */
376 void setBrush( const QBrush& brush);
377
378 /**
379 * Retrieve the brush to be used for painting datapoints globally. This will fall
380 * back automatically to the default settings, if there
381 * are no specific settings.
382 * @return The brush to use for painting.
383 */
384 QBrush brush() const;
385 /**
386 * Retrieve the brush to be used for the given dataset. This will fall
387 * back automatically to what was set at model level, if there
388 * are no dataset specific settings.
389 * @param dataset The dataset to retrieve the brush for.
390 * @return The brush to use for painting.
391 */
392 QBrush brush( int dataset ) const;
393 /**
394 * Retrieve the brush to be used, for painting the datapoint at the given
395 * index in the model.
396 * @param index The index of the datapoint in the model. With a dataset dimension
397 * of two, this is the index of the key of each key/value pair.
398 * @return The brush to use for painting.
399 */
400 QBrush brush( const QModelIndex& index ) const;
401
402 /**
403 * Set the unit prefix to be used on axes for one specific column.
404 * @param prefix The prefix to be used.
405 * @param column The column which should be set.
406 * @param orientation The orientation of the axis to use.
407 */
408 void setUnitPrefix( const QString& prefix, int column, Qt::Orientation orientation );
409 /**
410 * Set the unit prefix to be used on axes for all columns.
411 * @param prefix The prefix to be used.
412 * @param orientation The orientation of the axis to use.
413 */
414 void setUnitPrefix( const QString& prefix, Qt::Orientation orientation );
415
416 /**
417 * Set the unit prefix to be used on axes for one specific column.
418 * @param suffix The suffix to be used.
419 * @param column The column which should be set.
420 * @param orientation The orientation of the axis to use.
421 */
422 void setUnitSuffix( const QString& suffix, int column, Qt::Orientation orientation );
423 /**
424 * Set the unit prefix to be used on axes for all columns.
425 * @param suffix The suffix to be used.
426 * @param orientation The orientation of the axis to use.
427 */
428 void setUnitSuffix( const QString& suffix, Qt::Orientation orientation );
429
430 /**
431 * Retrieves the axis unit prefix for a specific column.
432 * @param column The column whose prefix should be retrieved.
433 * @param orientation The orientation of the axis.
434 * @param fallback If true, the prefix for all columns is returned, when
435 * none is set for the selected column.
436 * @return The axis unit prefix.
437 */
438 QString unitPrefix( int column, Qt::Orientation orientation, bool fallback = false ) const;
439 /**
440 * Retrieves the axis unit prefix.
441 * @param orientation The orientation of the axis.
442 * @return The axis unit prefix.
443 */
444 QString unitPrefix( Qt::Orientation orientation ) const;
445
446 /**
447 * Retrieves the axis unit suffix for a specific column.
448 * @param column The column whose prefix should be retrieved.
449 * @param orientation The orientation of the axis.
450 * @param fallback If true, the suffix for all columns is returned, when
451 * none is set for the selected column.
452 * @return The axis unit suffix.
453 */
454 QString unitSuffix( int column, Qt::Orientation orientation, bool fallback = false ) const;
455 /**
456 * Retrieves the axis unit suffix.
457 * @param orientation The orientation of the axis.
458 * @return The axis unit suffix.
459 */
460 QString unitSuffix( Qt::Orientation orientation ) const;
461
462 /**
463 * Set whether data value labels are allowed to overlap.
464 * @param allow True means that overlapping labels are allowed.
465 */
466 void setAllowOverlappingDataValueTexts( bool allow );
467
468 /**
469 * @return Whether data value labels are allowed to overlap.
470 */
471 bool allowOverlappingDataValueTexts() const;
472
473 /**
474 * Set whether anti-aliasing is to be used while rendering
475 * this diagram.
476 * @param enabled True means that AA is enabled.
477 */
478 void setAntiAliasing( bool enabled );
479
480 /**
481 * @return Whether anti-aliasing is to be used for rendering
482 * this diagram.
483 */
484 bool antiAliasing() const;
485
486 /**
487 * Set the palette to be used, for painting datasets to the default
488 * palette.
489 * @see KChart::Palette.
490 * FIXME: fold into one usePalette (KChart::Palette&) method
491 */
492 void useDefaultColors();
493
494 /**
495 * Set the palette to be used, for painting datasets to the rainbow
496 * palette.
497 * @see KChart::Palette.
498 */
499 void useRainbowColors();
500
501 /**
502 * Set the palette to be used, for painting datasets to the subdued
503 * palette.
504 * @see KChart::Palette.
505 */
506 void useSubduedColors();
507
508 /**
509 * The set of item row labels currently displayed, for use in Abscissa axes, etc.
510 * @return The set of item row labels currently displayed.
511 */
512 QStringList itemRowLabels() const;
513
514 /**
515 * The set of dataset labels currently displayed, for use in legends, etc.
516 * @return The set of dataset labels currently displayed.
517 */
518 QStringList datasetLabels() const;
519
520 /**
521 * The set of dataset brushes currently used, for use in legends, etc.
522 *
523 * @note Cell-level override brushes, if set, take precedence over the
524 * dataset values, so you might need to check these too, in order to find
525 * the brush, that is used for a single cell.
526 *
527 * @return The current set of dataset brushes.
528 */
529 QList<QBrush> datasetBrushes() const;
530
531 /**
532 * The set of dataset pens currently used, for use in legends, etc.
533 *
534 * @note Cell-level override pens, if set, take precedence over the
535 * dataset values, so you might need to check these too, in order to find
536 * the pens, that is used for a single cell.
537 *
538 * @return The current set of dataset pens.
539 */
540 QList<QPen> datasetPens() const;
541
542 /**
543 * The set of dataset markers currently used, for use in legends, etc.
544 *
545 * @note Cell-level override markers, if set, take precedence over the
546 * dataset values, so you might need to check these too, in order to find
547 * the marker, that is shown for a single cell.
548 *
549 * @return The current set of dataset brushes.
550 */
551 QList<MarkerAttributes> datasetMarkers() const;
552
553
554 /**
555 * \deprecated
556 *
557 * \brief Deprecated method that turns the percent mode of this diagram on or off.
558 *
559 * This method is deprecated. Use the setType() method of a supporting diagram implementation
560 * instead, e.g. BarDiagram::setType().
561 *
562 * \see percentMode
563 */
564 void setPercentMode( bool percent );
565
566
567 /**
568 * \brief Returns whether this diagram is drawn in percent mode.
569 *
570 * If true, all data points in the same column of a diagram will
571 * be be drawn at the same X coordinate and stacked up so that the distance from the
572 * last data point (or the zero line) to a data point P is always the ratio of (Y-Value of P)/
573 * (sum of all Y-Values in same column as P) relative to the diagrams height
574 * (or width, if abscissa and ordinate are swapped).
575 *
576 * Note that this property is not applicable to all diagram types.
577 */
578 bool percentMode() const;
579
580 virtual void paintMarker( QPainter* painter,
581 const MarkerAttributes& markerAttributes,
582 const QBrush& brush, const QPen&,
583 const QPointF& point, const QSizeF& size );
584
585 /**
586 * The dataset dimension of a diagram determines how many value dimensions
587 * it expects each datapoint to have.
588 * For each dimension and data series it will expect one column of values in the model.
589 * If the dimension is 1, automatic values will be used for X.
590 *
591 * For example, a diagram with the default dimension of 1 will have one column
592 * per data series (the Y values) and will use automatic values for X
593 * (1, 2, 3, ... n).
594 * If the dimension is 2, the diagram will use the first, (and the third,
595 * fifth, etc) columns as X values, and the second, (and the fourth, sixth,
596 * etc) column as Y values.
597 * @return The dataset dimension of the diagram.
598 */
599 int datasetDimension() const;
600
601 /**
602 * \deprecated
603 *
604 * Sets the dataset dimension of the diagram. Using this method
605 * is deprecated. Use the specific diagram types instead.
606 */
607 void setDatasetDimension( int dimension );
608
609 protected:
610 void setDatasetDimensionInternal( int dimension );
611
612 public:
613 void update() const;
614
615 void paintMarker( QPainter* painter, const DataValueAttributes& a,
616 const QModelIndex& index,
617 const QPointF& pos );
618 void paintMarker( QPainter* painter,
619 const QModelIndex& index,
620 const QPointF& pos );
621 void paintDataValueText( QPainter* painter, const QModelIndex& index,
622 const QPointF& pos, qreal value );
623
624 // reverse mapping:
625 /** This method is added alongside with indexAt from QAIM,
626 since in KChart multiple indexes can be displayed at the same
627 spot. */
628 QModelIndexList indexesAt( const QPoint& point ) const;
629 QModelIndexList indexesIn( const QRect& rect ) const;
630
631 protected:
632 virtual bool checkInvariants( bool justReturnTheStatus=false ) const;
633 virtual const QPair<QPointF, QPointF> calculateDataBoundaries() const = 0;
634
635 protected Q_SLOTS:
636 void setDataBoundariesDirty() const;
637
638 protected:
639 /**
640 * \deprecated
641 * This method is deprecated and provided for backward-compatibility only.
642 * Your own diagram classes should call
643 * d->paintDataValueTextsAndMarkers() instead
644 * which also is taking care for showing your cell-specific comments, if any,
645 */
646 virtual void paintDataValueTexts( QPainter* painter );
647 /**
648 * \deprecated
649 * This method is deprecated and provided for backward-compatibility only.
650 * Your own diagram classes should call
651 * d->paintDataValueTextsAndMarkers() instead
652 * which also is taking care for showing your cell-specific comments, if any,
653 */
654 virtual void paintMarkers( QPainter* painter );
655
656 /*! \internal */
657 void setAttributesModelRootIndex( const QModelIndex& );
658
659 /*! returns a QModelIndex pointing into the AttributesModel that corresponds to the
660 root index of the diagram. */
661 QModelIndex attributesModelRootIndex() const;
662
663 /**
664 * Helper method, retrieving the data value (DisplayRole) for a given row and column
665 * @param row The row to query.
666 * @param column The column to query.
667 * @return The value of the display role at the given row and column as a qreal.
668 * @deprecated
669 */
670 qreal valueForCell( int row, int column ) const;
671
672 Q_SIGNALS:
673 /** Diagrams are supposed to emit this signal, when the layout of one
674 of their element changes. Layouts can change, for example, when
675 axes are added or removed, or when the configuration was changed
676 in a way that the axes or the diagram itself are displayed in a
677 different geometry.
678 Changes in the diagrams coordinate system also result
679 in the layoutChanged() signal being emitted.
680 */
682
683 /**
684 * This signal is emitted when this diagram is being destroyed, but before all the
685 * data, i.e. the attributes model, is invalidated.
686 */
688
689 /** This signal is emitted when either the model or the AttributesModel is replaced. */
691
692 /** This signal is emitted just before the new attributes model is connected internally.
693 It gives you a chance to connect to its signals first or perform other setup work. */
695
696 /** This signal is emitted, when the model data is changed. */
698
699 /** This signal is emitted, when the hidden status of at least one data cell was (un)set. */
701
702 /** Emitted upon change of a property of the Diagram. */
704
705 /** Emitted upon change of a data boundary */
707 /** Emitted upon change of the view coordinate system */
709
710 private:
711 QModelIndex conditionallyMapFromSource( const QModelIndex & sourceIndex ) const;
712 };
713
716
717 /**
718 * @brief Internally used class just adding a special constructor used by AbstractDiagram
719 */
722 public:
723 explicit PrivateAttributesModel( QAbstractItemModel* model, QObject * parent = nullptr )
724 : AttributesModel(model,parent) {}
725 };
726}
727
728#endif
Contains KChart macros.
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane,...
AbstractDiagram defines the interface for diagram classes.
void modelsChanged()
This signal is emitted when either the model or the AttributesModel is replaced.
void aboutToBeDestroyed()
This signal is emitted when this diagram is being destroyed, but before all the data,...
void propertiesChanged()
Emitted upon change of a property of the Diagram.
void attributesModelAboutToChange(KChart::AttributesModel *newModel, KChart::AttributesModel *oldModel)
This signal is emitted just before the new attributes model is connected internally.
void layoutChanged(KChart::AbstractDiagram *)
Diagrams are supposed to emit this signal, when the layout of one of their element changes.
virtual void paint(PaintContext *paintContext)=0
Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint conte...
void modelDataChanged()
This signal is emitted, when the model data is changed.
void viewportCoordinateSystemChanged()
Emitted upon change of the view coordinate system.
void dataHidden()
This signal is emitted, when the hidden status of at least one data cell was (un)set.
void boundariesChanged()
Emitted upon change of a data boundary.
A proxy model used for decorating data with attributes.
Diagram attributes dealing with data value labels.
A set of attributes controlling the appearance of data set markers.
Stores information about painting diagrams.
Internally used class just adding a special constructor used by AbstractDiagram.
Q_OBJECTQ_OBJECT
QObject * parent() const const
typedef KeyboardModifiers
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.