![]() |
KD Chart API Documentation 3.0
|
AbstractDiagram defines the interface for diagram classes. More...
#include <KDChartAbstractDiagram.h>
Protected Slots | |
void | setDataBoundariesDirty () const |
AbstractDiagram defines the interface for diagram classes.
AbstractDiagram is the base class for diagram classes ("chart types").
It defines the interface, that needs to be implemented for the diagram, to function within the KDChart framework. It extends Interview's QAbstractItemView.
Definition at line 38 of file KDChartAbstractDiagram.h.
|
inlineexplicitprotected |
|
explicitprotected |
Definition at line 37 of file KDChartAbstractDiagram.cpp.
|
override |
Definition at line 45 of file KDChartAbstractDiagram.cpp.
References aboutToBeDestroyed(), and QObject::qobject_cast().
|
signal |
This signal is emitted when this diagram is being destroyed, but before all the data, i.e. the attributes model, is invalidated.
Referenced by ~AbstractDiagram().
bool AbstractDiagram::allowOverlappingDataValueTexts | ( | ) | const |
Definition at line 335 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by compare().
bool AbstractDiagram::antiAliasing | ( | ) | const |
Definition at line 346 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by compare().
|
virtual |
Returns the AttributesModel, that is used by this diagram. By default each diagram owns its own AttributesModel, which should never be deleted. Only if a user-supplied AttributesModel has been set does the pointer returned here not belong to the diagram.
Definition at line 168 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::TernaryLineDiagram::TernaryLineDiagram(), brush(), brush(), KDChart::StockDiagram::calculateDataBoundaries(), compare(), KDChart::Plotter::connectAttributesModel(), dataValueAttributes(), dataValueAttributes(), isHidden(), isHidden(), itemRowLabels(), KDChart::StockDiagram::paint(), pen(), pen(), KDChart::AbstractCartesianDiagram::setAttributesModel(), KDChart::BarDiagram::setBarAttributes(), setBrush(), setBrush(), setPen(), setPen(), KDChart::AbstractCartesianDiagram::setRootIndex(), KDChart::StockDiagram::setStockBarAttributes(), KDChart::StockDiagram::setThreeDBarAttributes(), KDChart::Plotter::setUseDataCompression(), KDChart::StockDiagram::stockBarAttributes(), and KDChart::StockDiagram::threeDBarAttributes().
|
signal |
This signal is emitted just before the new attributes model is connected internally. It gives you a chance to connect to its signals first or perform other setup work.
|
protected |
returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram.
Definition at line 196 of file KDChartAbstractDiagram.cpp.
References d, and QAbstractItemView::rootIndex().
Referenced by KDChart::StockDiagram::calculateDataBoundaries(), itemRowLabels(), KDChart::BarDiagram::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::Plotter::numberOfAbscissaSegments(), KDChart::BarDiagram::numberOfOrdinateSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(), KDChart::Plotter::numberOfOrdinateSegments(), KDChart::StockDiagram::paint(), and valueForCell().
|
signal |
Emitted upon change of a data boundary
Referenced by KDChart::Plotter::connectAttributesModel(), and KDChart::Plotter::setType().
QBrush AbstractDiagram::brush | ( | ) | const |
Retrieve the brush to be used for painting datapoints globally. This will fall back automatically to the default settings, if there are no specific settings.
Definition at line 664 of file KDChartAbstractDiagram.cpp.
References attributesModel(), KDChart::AttributesModel::data(), KDChart::DatasetBrushRole, and QVariant::value().
Referenced by brush(), datasetBrushes(), KDChart::TernaryLineDiagram::paint(), KDChart::TernaryPointDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::RadarDiagram::paint(), paintMarker(), paintMarker(), setBrush(), setBrush(), setBrush(), KDChart::StockDiagram::setDownTrendCandlestickBrush(), KDChart::StockDiagram::setDownTrendCandlestickBrush(), KDChart::StockDiagram::setUpTrendCandlestickBrush(), and KDChart::StockDiagram::setUpTrendCandlestickBrush().
QBrush AbstractDiagram::brush | ( | const QModelIndex & | index | ) | const |
Retrieve the brush to be used, for painting the datapoint at the given index in the model.
index | The index of the datapoint in the model. With a dataset dimension of two, this is the index of the key of each key/value pair. |
Definition at line 677 of file KDChartAbstractDiagram.cpp.
References attributesModel(), KDChart::AttributesModel::data(), KDChart::DatasetBrushRole, and QVariant::value().
Retrieve the brush to be used for the given dataset. This will fall back automatically to what was set at model level, if there are no dataset specific settings.
dataset | The dataset to retrieve the brush for. |
Definition at line 669 of file KDChartAbstractDiagram.cpp.
References brush(), d, KDChart::DatasetBrushRole, and QObject::qobject_cast().
|
protectedpure virtual |
Implemented in KDChart::BarDiagram, KDChart::LeveyJenningsDiagram, KDChart::LineDiagram, KDChart::Plotter, KDChart::StockDiagram, KDChart::PieDiagram, KDChart::PolarDiagram, KDChart::RadarDiagram, KDChart::RingDiagram, KDChart::TernaryLineDiagram, KDChart::TernaryPointDiagram, and KDChart::AbstractTernaryDiagram.
Referenced by dataBoundaries().
Definition at line 908 of file KDChartAbstractDiagram.cpp.
References coordinatePlane(), QAbstractItemView::model(), and QObject::qobject_cast().
Referenced by KDChart::BarDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculateDataBoundaries(), KDChart::Plotter::calculateDataBoundaries(), KDChart::PieDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculateDataBoundaries(), KDChart::RadarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::calculateDataBoundaries(), KDChart::BarDiagram::paint(), KDChart::LeveyJenningsDiagram::paint(), KDChart::LineDiagram::paint(), KDChart::Plotter::paint(), KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), KDChart::RadarDiagram::paint(), paintDataValueTexts(), paintMarker(), paintMarker(), and paintMarkers().
bool AbstractDiagram::compare | ( | const AbstractDiagram * | other | ) | const |
Returns true if both diagrams have the same settings.
Definition at line 57 of file KDChartAbstractDiagram.cpp.
References allowOverlappingDataValueTexts(), QAbstractItemView::alternatingRowColors, antiAliasing(), attributesModel(), QModelIndex::column(), KDChart::AttributesModel::compare(), datasetDimension(), QAbstractItemView::dragDropMode, QAbstractItemView::dragDropOverwriteMode, QAbstractItemView::dragEnabled, QAbstractItemView::editTriggers, QFrame::frameShadow, QFrame::frameShape, QAbstractItemView::hasAutoScroll(), QAbstractScrollArea::horizontalScrollBarPolicy, QAbstractItemView::horizontalScrollMode, QAbstractItemView::iconSize, QFrame::lineWidth, QFrame::midLineWidth, percentMode(), QObject::qobject_cast(), QAbstractItemView::rootIndex(), QModelIndex::row(), QAbstractItemView::selectionBehavior, QAbstractItemView::selectionMode, QAbstractItemView::showDropIndicator, QAbstractItemView::tabKeyNavigation, QAbstractItemView::textElideMode, QAbstractScrollArea::verticalScrollBarPolicy, and QAbstractItemView::verticalScrollMode.
AbstractCoordinatePlane * AbstractDiagram::coordinatePlane | ( | ) | const |
The coordinate plane associated with the diagram. This determines how coordinates in value space are mapped into pixel space. By default this is a CartesianCoordinatePlane.
Definition at line 79 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::Plotter::calcMergeRadius(), KDChart::BarDiagram::calculateDataBoundaries(), KDChart::LineDiagram::calculateDataBoundaries(), checkInvariants(), KDChart::Plotter::connectAttributesModel(), KDChart::AbstractAxis::coordinatePlane(), KDChart::LeveyJenningsDiagram::iconRect(), KDChart::CartesianAxis::layoutPlanes(), KDChart::PolarDiagram::paint(), KDChart::RadarDiagram::paint(), KDChart::CartesianAxis::paint(), paintDataValueTexts(), paintMarkers(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), KDChart::BarDiagram::resize(), KDChart::LineDiagram::resize(), KDChart::Plotter::resize(), and KDChart::StockDiagram::resize().
Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these values).
This method returns a cached result of calculations done by calculateDataBoundaries. Classes derived from AbstractDiagram must implement the calculateDataBoundaries function, to specify their own way of calculating the data boundaries. If derived classes want to force recalculation of the data boundaries, they can call setDataBoundariesDirty()
Returned value is in diagram coordinates.
Definition at line 84 of file KDChartAbstractDiagram.cpp.
References calculateDataBoundaries(), and d.
Referenced by KDChart::PolarGrid::drawGrid(), KDChart::RadarGrid::drawGrid(), KDChart::CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams(), KDChart::BarDiagram::paint(), KDChart::LeveyJenningsDiagram::paint(), KDChart::LineDiagram::paint(), KDChart::Plotter::paint(), and KDChart::RadarDiagram::paint().
|
overridevirtual |
Reimplemented for internal purposes.
Reimplemented from QAbstractItemView.
Definition at line 217 of file KDChartAbstractDiagram.cpp.
References QObject::qobject_cast(), QAbstractItemView::scheduleDelayedItemsLayout(), and setDataBoundariesDirty().
Referenced by KDChart::LeveyJenningsDiagram::setModel().
|
signal |
This signal is emitted, when the hidden status of at least one data cell was (un)set.
Referenced by setHidden(), setHidden(), and setHidden().
The set of dataset brushes currently used, for use in legends, etc.
Definition at line 869 of file KDChartAbstractDiagram.cpp.
References brush(), d, QAbstractItemView::model(), and QObject::qobject_cast().
Referenced by KDChart::Legend::datasetCount(), and KDChart::Legend::setBrushesFromDiagram().
int AbstractDiagram::datasetDimension | ( | ) | const |
The dataset dimension of a diagram determines how many value dimensions it expects each datapoint to have. For each dimension and data series it will expect one column of values in the model. If the dimension is 1, automatic values will be used for X.
For example, a diagram with the default dimension of 1 will have one column per data series (the Y values) and will use automatic values for X (1, 2, 3, ... n). If the dimension is 2, the diagram will use the first, (and the third, fifth, etc) columns as X values, and the second, (and the fourth, sixth, etc) column as Y values.
Definition at line 920 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by compare(), KDChart::TernaryLineDiagram::paint(), KDChart::TernaryPointDiagram::paint(), paintDataValueTexts(), paintMarkers(), KDChart::LineDiagram::setType(), and KDChart::Plotter::setType().
QStringList AbstractDiagram::datasetLabels | ( | ) | const |
The set of dataset labels currently displayed, for use in legends, etc.
Definition at line 856 of file KDChartAbstractDiagram.cpp.
References d, Qt::DisplayRole, QAbstractItemView::model(), and QObject::qobject_cast().
Referenced by KDChart::Legend::datasetCount().
QList< MarkerAttributes > AbstractDiagram::datasetMarkers | ( | ) | const |
The set of dataset markers currently used, for use in legends, etc.
Definition at line 895 of file KDChartAbstractDiagram.cpp.
References d, dataValueAttributes(), KDChart::DataValueAttributes::markerAttributes(), QAbstractItemView::model(), and QObject::qobject_cast().
The set of dataset pens currently used, for use in legends, etc.
Definition at line 882 of file KDChartAbstractDiagram.cpp.
References d, QAbstractItemView::model(), pen(), and QObject::qobject_cast().
DataValueAttributes AbstractDiagram::dataValueAttributes | ( | ) | const |
Retrieve the DataValueAttributes specified globally. This will fall back automatically to the default settings, if there are no specific settings.
Definition at line 287 of file KDChartAbstractDiagram.cpp.
References attributesModel(), KDChart::DataValueLabelAttributesRole, KDChart::AttributesModel::modelData(), and QVariant::value().
Referenced by KDChart::TernaryLineDiagram::TernaryLineDiagram(), datasetMarkers(), dataValueAttributes(), KDChart::TernaryLineDiagram::paint(), KDChart::TernaryPointDiagram::paint(), paintMarker(), and setAllowOverlappingDataValueTexts().
DataValueAttributes AbstractDiagram::dataValueAttributes | ( | const QModelIndex & | index | ) | const |
Retrieve the DataValueAttributes for the given index. This will fall back automatically to what was set at dataset or model level, if there are no datapoint specific settings.
index | The datapoint to retrieve the attributes for. With a dataset dimension of two, this is the index of the key of each key/value pair. |
Definition at line 312 of file KDChartAbstractDiagram.cpp.
References attributesModel(), KDChart::AttributesModel::data(), KDChart::DataValueLabelAttributesRole, and QVariant::value().
DataValueAttributes AbstractDiagram::dataValueAttributes | ( | int | dataset | ) | const |
Retrieve the DataValueAttributes for the given dataset. This will fall back automatically to what was set at model level, if there are no dataset specific settings.
dataset | The dataset to retrieve the attributes for. |
Definition at line 292 of file KDChartAbstractDiagram.cpp.
References d, dataValueAttributes(), KDChart::DataValueLabelAttributesRole, and QObject::qobject_cast().
|
override |
Reimplemented for internal purposes.
Definition at line 208 of file KDChartAbstractDiagram.cpp.
Referenced by setModel().
|
overridevirtual |
Reimplemented for internal purposes.
Implements QAbstractItemView.
Definition at line 787 of file KDChartAbstractDiagram.cpp.
|
overridevirtual |
Reimplemented for internal purposes.
Implements QAbstractItemView.
Definition at line 962 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by KDChart::Chart::event().
This method is added alongside with indexAt from QAIM, since in kdchart multiple indexes can be displayed at the same spot.
Definition at line 967 of file KDChartAbstractDiagram.cpp.
References d.
Definition at line 972 of file KDChartAbstractDiagram.cpp.
References d, and QWidget::rect.
Referenced by KDChart::Chart::event().
bool AbstractDiagram::isHidden | ( | ) | const |
Retrieve the hidden status specified globally. This will fall back automatically to the default settings ( = not hidden), if there are no specific settings.
Definition at line 249 of file KDChartAbstractDiagram.cpp.
References attributesModel(), KDChart::DataHiddenRole, KDChart::AttributesModel::modelData(), and QVariant::value().
Referenced by isHidden(), and isHidden().
bool AbstractDiagram::isHidden | ( | const QModelIndex & | index | ) | const |
Retrieve the hidden status for the given index. This will fall back automatically to what was set at dataset or diagram level, if there are no datapoint specific settings.
index | The datapoint to retrieve the hidden status for. |
Definition at line 262 of file KDChartAbstractDiagram.cpp.
References attributesModel(), QModelIndex::column(), d, KDChart::DataHiddenRole, isHidden(), and QObject::qobject_cast().
Retrieve the hidden status for the given dataset. This will fall back automatically to what was set at diagram level, if there are no dataset specific settings.
dataset | The dataset to retrieve the hidden status for. |
Definition at line 254 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DataHiddenRole, isHidden(), and QObject::qobject_cast().
|
overridevirtual |
Reimplemented for internal purposes.
Implements QAbstractItemView.
Definition at line 797 of file KDChartAbstractDiagram.cpp.
QStringList AbstractDiagram::itemRowLabels | ( | ) | const |
The set of item row labels currently displayed, for use in Abscissa axes, etc.
Definition at line 842 of file KDChartAbstractDiagram.cpp.
References attributesModel(), attributesModelRootIndex(), Qt::DisplayRole, KDChart::AttributesModel::headerData(), Qt::Horizontal, QAbstractItemView::model(), QObject::qobject_cast(), KDChart::AttributesModel::rowCount(), QVariant::toString(), unitPrefix(), unitSuffix(), and Qt::Vertical.
|
signal |
Diagrams are supposed to emit this signal, when the layout of one of their element changes. Layouts can change, for example, when axes are added or removed, or when the configuration was changed in a way that the axes or the diagram itself are displayed in a different geometry. Changes in the diagrams coordinate system also result in the layoutChanged() signal being emitted.
Referenced by KDChart::LineDiagram::setCenterDataPoints(), setDatasetDimensionInternal(), KDChart::LeveyJenningsDiagram::setModel(), KDChart::AbstractPieDiagram::setPieAttributes(), KDChart::AbstractPieDiagram::setPieAttributes(), KDChart::AbstractPieDiagram::setPieAttributes(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::AbstractPieDiagram::setThreeDPieAttributes(), KDChart::AbstractPieDiagram::setThreeDPieAttributes(), KDChart::AbstractPieDiagram::setThreeDPieAttributes(), KDChart::LineDiagram::setType(), and KDChart::Plotter::setType().
|
signal |
This signal is emitted, when the model data is changed.
|
signal |
This signal is emitted when either the model or the AttributesModel is replaced.
Referenced by setAttributesModel(), setModel(), and setSelectionModel().
|
overridevirtual |
Reimplemented for internal purposes.
Implements QAbstractItemView.
Definition at line 782 of file KDChartAbstractDiagram.cpp.
|
pure virtual |
Draw the diagram contents to the rectangle and painter, that are passed in as part of the paint context.
paintContext | All information needed for painting. |
Implemented in KDChart::BarDiagram, KDChart::LeveyJenningsDiagram, KDChart::LineDiagram, KDChart::Plotter, KDChart::StockDiagram, KDChart::PieDiagram, KDChart::PolarDiagram, KDChart::RadarDiagram, KDChart::RingDiagram, KDChart::TernaryLineDiagram, and KDChart::TernaryPointDiagram.
void AbstractDiagram::paintDataValueText | ( | QPainter * | painter, |
const QModelIndex & | index, | ||
const QPointF & | pos, | ||
qreal | value | ||
) |
Definition at line 362 of file KDChartAbstractDiagram.cpp.
References d, and QWidget::pos.
Referenced by paintDataValueTexts().
Definition at line 370 of file KDChartAbstractDiagram.cpp.
References checkInvariants(), QAbstractItemModel::columnCount(), coordinatePlane(), d, QModelIndex::data(), datasetDimension(), QAbstractItemModel::index(), QAbstractItemView::model(), paintDataValueText(), QObject::qobject_cast(), QAbstractItemView::rootIndex(), QAbstractItemModel::rowCount(), QVariant::toReal(), translate(), QWidget::x, and QWidget::y.
void AbstractDiagram::paintMarker | ( | QPainter * | painter, |
const DataValueAttributes & | a, | ||
const QModelIndex & | index, | ||
const QPointF & | pos | ||
) |
Definition at line 396 of file KDChartAbstractDiagram.cpp.
References brush(), checkInvariants(), QModelIndex::column(), d, KDChart::DataValueAttributes::isVisible(), QTransform::m11(), QTransform::m22(), KDChart::DataValueAttributes::markerAttributes(), paintMarker(), QWidget::pos, QObject::qobject_cast(), QModelIndex::row(), and QPainter::transform().
|
virtual |
Definition at line 435 of file KDChartAbstractDiagram.cpp.
References QPainter::Antialiasing, QPainterPath::boundingRect(), brush(), QBrush::color(), KDChart::MarkerAttributes::customMarkerPath(), QPainter::drawEllipse(), QPainter::drawLine(), QPainter::drawPath(), QPainter::drawPoint(), QPainter::drawPolygon(), QPainter::drawRect(), QRectF::height(), QColor::lighter(), KDChart::MarkerAttributes::Marker1Pixel, KDChart::MarkerAttributes::Marker4Pixels, KDChart::MarkerAttributes::MarkerCircle, KDChart::MarkerAttributes::MarkerCross, KDChart::MarkerAttributes::MarkerDiamond, KDChart::MarkerAttributes::MarkerFastCross, KDChart::MarkerAttributes::MarkerRing, KDChart::MarkerAttributes::MarkerSquare, KDChart::MarkerAttributes::markerStyle(), Qt::NoBrush, KDChart::MarkerAttributes::NoMarker, QGradient::ObjectBoundingMode, KDChart::MarkerAttributes::PainterPathMarker, pen(), QPainter::pen(), QWidget::pos, QObject::qobject_cast(), QWidget::rect, QPainter::scale(), KDChart::PrintingParameters::scalePen(), QPainter::setBrush(), QGradient::setCoordinateMode(), QPainter::setPen(), QPainter::setRenderHint(), KDChart::MarkerAttributes::threeD(), QBrush::transform(), QPainter::translate(), QWidget::x, and QWidget::y.
Referenced by KDChart::TernaryLineDiagram::paint(), KDChart::TernaryPointDiagram::paint(), KDChart::MarkerLayoutItem::paintIntoRect(), paintMarker(), paintMarker(), and paintMarkers().
void AbstractDiagram::paintMarker | ( | QPainter * | painter, |
const QModelIndex & | index, | ||
const QPointF & | pos | ||
) |
Definition at line 426 of file KDChartAbstractDiagram.cpp.
References checkInvariants(), dataValueAttributes(), paintMarker(), and QWidget::pos.
Definition at line 576 of file KDChartAbstractDiagram.cpp.
References checkInvariants(), QAbstractItemModel::columnCount(), coordinatePlane(), QModelIndex::data(), datasetDimension(), QAbstractItemModel::index(), QAbstractItemView::model(), paintMarker(), QObject::qobject_cast(), QAbstractItemView::rootIndex(), QAbstractItemModel::rowCount(), QVariant::toReal(), translate(), QWidget::x, and QWidget::y.
QPen AbstractDiagram::pen | ( | ) | const |
Retrieve the pen to be used for painting datapoints globally. This will fall back automatically to the default settings, if there are no specific settings.
Definition at line 622 of file KDChartAbstractDiagram.cpp.
References attributesModel(), KDChart::AttributesModel::data(), KDChart::DatasetPenRole, and QVariant::value().
Referenced by datasetPens(), KDChart::LeveyJenningsDiagram::paint(), KDChart::TernaryLineDiagram::paint(), KDChart::TernaryPointDiagram::paint(), paintMarker(), pen(), KDChart::StockDiagram::setDownTrendCandlestickPen(), KDChart::StockDiagram::setDownTrendCandlestickPen(), KDChart::StockDiagram::setLowHighLinePen(), KDChart::StockDiagram::setLowHighLinePen(), setPen(), setPen(), setPen(), KDChart::LeveyJenningsDiagram::setScanLinePen(), KDChart::StockDiagram::setUpTrendCandlestickPen(), and KDChart::StockDiagram::setUpTrendCandlestickPen().
QPen AbstractDiagram::pen | ( | const QModelIndex & | index | ) | const |
Retrieve the pen to be used, for painting the datapoint at the given index in the model.
index | The index of the datapoint in the model. With a dataset dimension of two, this is the index of the key of each key/value pair. |
Definition at line 635 of file KDChartAbstractDiagram.cpp.
References attributesModel(), KDChart::AttributesModel::data(), KDChart::DatasetPenRole, and QVariant::value().
Retrieve the pen to be used for the given dataset. This will fall back automatically to what was set at model level, if there are no dataset specific settings.
dataset | The dataset to retrieve the pen for. |
Definition at line 627 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DatasetPenRole, pen(), and QObject::qobject_cast().
bool AbstractDiagram::percentMode | ( | ) | const |
Returns whether this diagram is drawn in percent mode.
If true, all data points in the same column of a diagram will be drawn at the same X coordinate and stacked up so that the distance from the last data point (or the zero line) to a data point P is always the ratio of (Y-Value of P)/ (sum of all Y-Values in same column as P) relative to the diagrams height (or width, if abscissa and ordinate are swapped).
Note that this property is not applicable to all diagram types.
Definition at line 357 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by compare().
|
signal |
Emitted upon change of a property of the Diagram.
Referenced by KDChart::LineDiagram::resetLineAttributes(), KDChart::Plotter::resetLineAttributes(), KDChart::LineDiagram::resetLineAttributes(), KDChart::Plotter::resetLineAttributes(), setAllowOverlappingDataValueTexts(), setAntiAliasing(), KDChart::BarDiagram::setBarAttributes(), KDChart::BarDiagram::setBarAttributes(), KDChart::BarDiagram::setBarAttributes(), setBrush(), setBrush(), setBrush(), KDChart::LineDiagram::setCenterDataPoints(), setDataValueAttributes(), setDataValueAttributes(), setDataValueAttributes(), KDChart::LineDiagram::setLineAttributes(), KDChart::Plotter::setLineAttributes(), KDChart::LineDiagram::setLineAttributes(), KDChart::Plotter::setLineAttributes(), KDChart::LineDiagram::setLineAttributes(), KDChart::Plotter::setLineAttributes(), KDChart::LineDiagram::setLineTension(), setPen(), setPen(), setPen(), setPercentMode(), KDChart::StockDiagram::setStockBarAttributes(), KDChart::StockDiagram::setStockBarAttributes(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::StockDiagram::setThreeDBarAttributes(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::StockDiagram::setThreeDBarAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::Plotter::setThreeDLineAttributes(), KDChart::LineDiagram::setType(), KDChart::Plotter::setType(), KDChart::StockDiagram::setType(), KDChart::LineDiagram::setValueTrackerAttributes(), and KDChart::Plotter::setValueTrackerAttributes().
Called by the widget's sizeEvent. Adjust all internal structures, that are calculated, depending on the size of the widget.
area | Size of the widget |
Implemented in KDChart::BarDiagram, KDChart::LineDiagram, KDChart::Plotter, KDChart::PieDiagram, KDChart::PolarDiagram, KDChart::RadarDiagram, KDChart::RingDiagram, KDChart::TernaryLineDiagram, KDChart::TernaryPointDiagram, and KDChart::StockDiagram.
Referenced by KDChart::CartesianCoordinatePlane::setGeometry().
|
overridevirtual |
Reimplemented for internal purposes.
Implements QAbstractItemView.
Definition at line 776 of file KDChartAbstractDiagram.cpp.
Set whether data value labels are allowed to overlap.
allow | True means that overlapping labels are allowed. |
Definition at line 326 of file KDChartAbstractDiagram.cpp.
References d, dataValueAttributes(), propertiesChanged(), QObject::qobject_cast(), and setDataValueAttributes().
Set whether anti-aliasing is to be used while rendering this diagram.
enabled | True means that AA is enabled. |
Definition at line 340 of file KDChartAbstractDiagram.cpp.
References d, QWidget::enabled, propertiesChanged(), and QObject::qobject_cast().
|
virtual |
Sets an external AttributesModel on this diagram.
Associate an AttributesModel with this diagram. Note that the diagram does not take ownership of the AttributesModel. This should thus only be used with AttributesModels that have been explicitly created by the user, and are owned by her. Setting an AttributesModel that is internal to another diagram is an error.
Correct:
Wrong:
model | The AttributesModel to use for this diagram. |
By default, a diagram has it's own internal set of attributes, but an external one can be set. This can be used to share attributes between several diagrams. The diagram does not take ownership of the attributesmodel.
amodel | The AttributesModel to use for this diagram. |
Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 143 of file KDChartAbstractDiagram.cpp.
References d, QAbstractItemView::model(), modelsChanged(), QObject::qobject_cast(), QAbstractItemView::scheduleDelayedItemsLayout(), and setDataBoundariesDirty().
Referenced by KDChart::AbstractCartesianDiagram::setAttributesModel().
|
protected |
Definition at line 187 of file KDChartAbstractDiagram.cpp.
References d, QObject::qobject_cast(), QAbstractItemView::scheduleDelayedItemsLayout(), and setDataBoundariesDirty().
Referenced by setRootIndex().
Set the brush to be used, for painting all datasets in the model.
brush | The brush to use. |
Definition at line 651 of file KDChartAbstractDiagram.cpp.
References attributesModel(), brush(), KDChart::DatasetBrushRole, QVariant::fromValue(), propertiesChanged(), QObject::qobject_cast(), and KDChart::AttributesModel::setModelData().
void AbstractDiagram::setBrush | ( | const QModelIndex & | index, |
const QBrush & | brush | ||
) |
Set the brush to be used, for painting the datapoint at the given index.
index | The datapoint's index in the model. With a dataset dimension of two, this is the index of the key of each key/value pair. |
brush | The brush to use. |
Definition at line 643 of file KDChartAbstractDiagram.cpp.
References attributesModel(), brush(), KDChart::DatasetBrushRole, QVariant::fromValue(), propertiesChanged(), QObject::qobject_cast(), and KDChart::AttributesModel::setData().
Set the brush to be used, for painting the given dataset.
dataset | The dataset to set the brush for. |
brush | The brush to use. |
Definition at line 658 of file KDChartAbstractDiagram.cpp.
References brush(), d, KDChart::DatasetBrushRole, QVariant::fromValue(), propertiesChanged(), and QObject::qobject_cast().
|
virtual |
Set the coordinate plane associated with the diagram. This determines how coordinates in value space are mapped into pixel space. The chart takes ownership.
Reimplemented in KDChart::AbstractCartesianDiagram.
Definition at line 203 of file KDChartAbstractDiagram.cpp.
References d, and QObject::parent().
Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::AbstractCartesianDiagram::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::takeDiagram().
|
protectedslot |
Definition at line 93 of file KDChartAbstractDiagram.cpp.
Referenced by dataChanged(), KDChart::BarDiagram::resize(), KDChart::LineDiagram::resize(), KDChart::StockDiagram::resize(), setAttributesModel(), setAttributesModelRootIndex(), KDChart::LineDiagram::setCenterDataPoints(), KDChart::Plotter::setDataBoundariesDirty(), setDatasetDimensionInternal(), setModel(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), and KDChart::LineDiagram::setType().
Sets the dataset dimension of the diagram. Using this method is deprecated. Use the specific diagram types instead.
Definition at line 925 of file KDChartAbstractDiagram.cpp.
References QObject::qobject_cast().
Definition at line 932 of file KDChartAbstractDiagram.cpp.
References d, layoutChanged(), QObject::qobject_cast(), and setDataBoundariesDirty().
Referenced by KDChart::TernaryLineDiagram::TernaryLineDiagram(), and KDChart::TernaryPointDiagram::TernaryPointDiagram().
void AbstractDiagram::setDataValueAttributes | ( | const DataValueAttributes & | a | ) |
Set the DataValueAttributes for all datapoints in the model.
a | The attributes to set. |
Definition at line 320 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DataValueLabelAttributesRole, QVariant::fromValue(), propertiesChanged(), and QObject::qobject_cast().
void AbstractDiagram::setDataValueAttributes | ( | const QModelIndex & | index, |
const DataValueAttributes & | a | ||
) |
Set the DataValueAttributes for the given index.
index | The datapoint to set the attributes for. With a dataset dimension of two, this is the index of the key of each key/value pair. |
a | The attributes to set. |
Definition at line 273 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DataValueLabelAttributesRole, QVariant::fromValue(), propertiesChanged(), and QObject::qobject_cast().
Referenced by setAllowOverlappingDataValueTexts().
void AbstractDiagram::setDataValueAttributes | ( | int | dataset, |
const DataValueAttributes & | a | ||
) |
Set the DataValueAttributes for the given dataset.
dataset | The dataset to set the attributes for. |
a | The attributes to set. |
Definition at line 281 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DataValueLabelAttributesRole, QVariant::fromValue(), propertiesChanged(), and QObject::qobject_cast().
Hide (or unhide, resp.) all datapoints in the model.
hidden | The hidden status to set. |
Definition at line 243 of file KDChartAbstractDiagram.cpp.
References d, dataHidden(), KDChart::DataHiddenRole, QVariant::fromValue(), and QObject::qobject_cast().
void AbstractDiagram::setHidden | ( | const QModelIndex & | index, |
bool | hidden | ||
) |
Hide (or unhide, resp.) a data cell.
index | The datapoint to set the hidden status for. With a dataset dimension of two, this is the index of the key of each key/value pair. |
hidden | The hidden status to set. |
Definition at line 228 of file KDChartAbstractDiagram.cpp.
References d, dataHidden(), KDChart::DataHiddenRole, QVariant::fromValue(), and QObject::qobject_cast().
Hide (or unhide, resp.) a dataset.
dataset | The dataset to set the hidden status for. |
hidden | The hidden status to set. |
Definition at line 237 of file KDChartAbstractDiagram.cpp.
References d, dataHidden(), KDChart::DataHiddenRole, QVariant::fromValue(), and QObject::qobject_cast().
|
overridevirtual |
Associate a model with the diagram.
Reimplemented from QAbstractItemView.
Reimplemented in KDChart::LeveyJenningsDiagram.
Definition at line 99 of file KDChartAbstractDiagram.cpp.
References QObject::connect(), d, QObject::disconnect(), doItemsLayout(), QAbstractItemView::model(), QAbstractItemModel::modelReset(), modelsChanged(), QObject::qobject_cast(), QAbstractItemView::scheduleDelayedItemsLayout(), setDataBoundariesDirty(), and QAbstractItemView::setModel().
Referenced by KDChart::AbstractCartesianDiagram::setModel().
void AbstractDiagram::setPen | ( | const QModelIndex & | index, |
const QPen & | pen | ||
) |
Set the pen to be used, for painting the datapoint at the given index.
index | The datapoint's index in the model. With a dataset dimension of two, this is the index of the key of each key/value pair. |
pen | The pen to use. |
Definition at line 601 of file KDChartAbstractDiagram.cpp.
References attributesModel(), KDChart::DatasetPenRole, QVariant::fromValue(), pen(), propertiesChanged(), QObject::qobject_cast(), and KDChart::AttributesModel::setData().
Set the pen to be used, for painting all datasets in the model.
pen | The pen to use. |
Definition at line 609 of file KDChartAbstractDiagram.cpp.
References attributesModel(), KDChart::DatasetPenRole, QVariant::fromValue(), pen(), propertiesChanged(), QObject::qobject_cast(), and KDChart::AttributesModel::setModelData().
Set the pen to be used, for painting the given dataset.
dataset | The dataset to set the pen for. |
pen | The pen to use. |
Definition at line 616 of file KDChartAbstractDiagram.cpp.
References d, KDChart::DatasetPenRole, QVariant::fromValue(), pen(), propertiesChanged(), and QObject::qobject_cast().
Deprecated method that turns the percent mode of this diagram on or off.
This method is deprecated. Use the setType() method of a supporting diagram implementation instead, e.g. BarDiagram::setType().
Definition at line 351 of file KDChartAbstractDiagram.cpp.
References d, propertiesChanged(), and QObject::qobject_cast().
Referenced by KDChart::LineDiagram::setType().
|
overridevirtual |
Reimplemented for internal purposes.
Set the root index in the model, where the diagram starts referencing data for display.
Reimplemented from QAbstractItemView.
Definition at line 180 of file KDChartAbstractDiagram.cpp.
References d, QObject::qobject_cast(), setAttributesModelRootIndex(), and QAbstractItemView::setRootIndex().
Referenced by KDChart::AbstractCartesianDiagram::setRootIndex().
|
overridevirtual |
Reimplemented for internal purposes.
Implements QAbstractItemView.
Definition at line 802 of file KDChartAbstractDiagram.cpp.
References QList::append(), d, QObject::qobject_cast(), QWidget::rect, QItemSelectionModel::select(), and QAbstractItemView::selectionModel().
|
overridevirtual |
Associate a seleection model with the diagrom.
Reimplemented from QAbstractItemView.
Definition at line 122 of file KDChartAbstractDiagram.cpp.
References QObject::connect(), QAbstractItemView::currentChanged(), QObject::disconnect(), modelsChanged(), QObject::qobject_cast(), QAbstractItemView::selectionChanged(), QAbstractItemView::selectionModel(), and QAbstractItemView::setSelectionModel().
void AbstractDiagram::setUnitPrefix | ( | const QString & | prefix, |
int | column, | ||
Qt::Orientation | orientation | ||
) |
Set the unit prefix to be used on axes for one specific column.
prefix | The prefix to be used. |
column | The column which should be set. |
orientation | The orientation of the axis to use. |
Sets the unit prefix for one value
prefix | the prefix to be set |
column | the value using that prefix |
orientation | the orientantion of the axis to set |
Definition at line 688 of file KDChartAbstractDiagram.cpp.
References d.
void AbstractDiagram::setUnitPrefix | ( | const QString & | prefix, |
Qt::Orientation | orientation | ||
) |
Set the unit prefix to be used on axes for all columns.
prefix | The prefix to be used. |
orientation | The orientation of the axis to use. |
Sets the unit prefix for all values
prefix | the prefix to be set |
orientation | the orientantion of the axis to set |
Definition at line 698 of file KDChartAbstractDiagram.cpp.
References d.
void AbstractDiagram::setUnitSuffix | ( | const QString & | suffix, |
int | column, | ||
Qt::Orientation | orientation | ||
) |
Set the unit prefix to be used on axes for one specific column.
suffix | The suffix to be used. |
column | The column which should be set. |
orientation | The orientation of the axis to use. |
Sets the unit suffix for one value
suffix | the suffix to be set |
column | the value using that suffix |
orientation | the orientantion of the axis to set |
Definition at line 709 of file KDChartAbstractDiagram.cpp.
References d.
void AbstractDiagram::setUnitSuffix | ( | const QString & | suffix, |
Qt::Orientation | orientation | ||
) |
Set the unit prefix to be used on axes for all columns.
suffix | The suffix to be used. |
orientation | The orientation of the axis to use. |
Sets the unit suffix for all values
suffix | the suffix to be set |
orientation | the orientantion of the axis to set |
Definition at line 719 of file KDChartAbstractDiagram.cpp.
References d.
QString AbstractDiagram::unitPrefix | ( | int | column, |
Qt::Orientation | orientation, | ||
bool | fallback = false |
||
) | const |
Retrieves the axis unit prefix for a specific column.
column | The column whose prefix should be retrieved. |
orientation | The orientation of the axis. |
fallback | If true, the prefix for all columns is returned, when none is set for the selected column. |
Returns the unit prefix for a special value
column | the value which's prefix is requested |
orientation | the orientation of the axis |
fallback | if true, the global prefix is return when no specific one is set for that value |
Definition at line 731 of file KDChartAbstractDiagram.cpp.
References d, and QObject::qobject_cast().
Referenced by itemRowLabels().
QString AbstractDiagram::unitPrefix | ( | Qt::Orientation | orientation | ) | const |
Retrieves the axis unit prefix.
orientation | The orientation of the axis. |
Returns the global unit prefix
orientation | the orientation of the axis |
Definition at line 742 of file KDChartAbstractDiagram.cpp.
References d.
QString AbstractDiagram::unitSuffix | ( | int | column, |
Qt::Orientation | orientation, | ||
bool | fallback = false |
||
) | const |
Retrieves the axis unit suffix for a specific column.
column | The column whose prefix should be retrieved. |
orientation | The orientation of the axis. |
fallback | If true, the suffix for all columns is returned, when none is set for the selected column. |
Returns the unit suffix for a special value
column | the value which's suffix is requested |
orientation | the orientation of the axis |
fallback | if true, the global suffix is return when no specific one is set for that value |
Definition at line 754 of file KDChartAbstractDiagram.cpp.
References d, and QObject::qobject_cast().
Referenced by itemRowLabels().
QString AbstractDiagram::unitSuffix | ( | Qt::Orientation | orientation | ) | const |
Retrieves the axis unit suffix.
orientation | The orientation of the axis. |
Returns the global unit suffix
orientation | the orientation of the axis |
Definition at line 765 of file KDChartAbstractDiagram.cpp.
References d.
void AbstractDiagram::update | ( | ) | const |
Definition at line 955 of file KDChartAbstractDiagram.cpp.
References d.
Referenced by doItemsLayout(), setDataBoundariesDirty(), KDChart::LeveyJenningsDiagram::setExpectedMeanValue(), KDChart::LeveyJenningsDiagram::setExpectedStandardDeviation(), KDChart::LeveyJenningsDiagram::setFluidicsPackChangedSymbolPosition(), KDChart::LeveyJenningsDiagram::setFluidicsPackChanges(), KDChart::LeveyJenningsDiagram::setLotChangedSymbolPosition(), KDChart::LeveyJenningsDiagram::setScanLinePen(), KDChart::LeveyJenningsDiagram::setSensorChangedSymbolPosition(), KDChart::LeveyJenningsDiagram::setSensorChanges(), KDChart::LeveyJenningsDiagram::setSymbol(), KDChart::LeveyJenningsDiagram::setTimeRange(), and KDChart::AbstractAxis::update().
void KDChart::AbstractDiagram::useDefaultColors | ( | ) |
Set the palette to be used, for painting datasets to the default palette.
Definition at line 827 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AttributesModel::PaletteTypeDefault.
void KDChart::AbstractDiagram::useRainbowColors | ( | ) |
Set the palette to be used, for painting datasets to the rainbow palette.
Definition at line 837 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AttributesModel::PaletteTypeRainbow.
|
virtual |
Returns whether the diagram is using its own built-in attributes model or an attributes model that was set via setAttributesModel.
Definition at line 163 of file KDChartAbstractDiagram.cpp.
References d.
void KDChart::AbstractDiagram::useSubduedColors | ( | ) |
Set the palette to be used, for painting datasets to the subdued palette.
Definition at line 832 of file KDChartAbstractDiagram.cpp.
References d, and KDChart::AttributesModel::PaletteTypeSubdued.
Helper method, retrieving the data value (DisplayRole) for a given row and column
row | The row to query. |
column | The column to query. |
Definition at line 944 of file KDChartAbstractDiagram.cpp.
References attributesModelRootIndex(), d, and QObject::qobject_cast().
|
overridevirtual |
Reimplemented for internal purposes.
Implements QAbstractItemView.
Definition at line 792 of file KDChartAbstractDiagram.cpp.
|
signal |
Emitted upon change of the view coordinate system
|
overridevirtual |
Reimplemented for internal purposes.
Implements QAbstractItemView.
Definition at line 771 of file KDChartAbstractDiagram.cpp.
References QModelIndex::column(), d, and QModelIndex::row().
|
virtual |
Definition at line 821 of file KDChartAbstractDiagram.cpp.
References QModelIndex::column(), d, QVector::isEmpty(), QModelIndex::row(), and QPolygonF::toPolygon().
|
overridevirtual |
Reimplemented for internal purposes.
Implements QAbstractItemView.
Definition at line 812 of file KDChartAbstractDiagram.cpp.
References QModelIndex::column(), d, QItemSelection::indexes(), QVector::isEmpty(), QObject::qobject_cast(), QModelIndex::row(), and QPolygonF::toPolygon().