#include <KDChartPieDiagram.h>
Inheritance diagram for KDChart::PieDiagram:
Public Member Functions | |
bool | allowOverlappingDataValueTexts () const |
bool | antiAliasing () const |
virtual AttributesModel * | attributesModel () const |
Returns the AttributesModel, that is used by this diagram. | |
QBrush | brush (const QModelIndex &index) const |
Retrieve the brush to be used, for painting the datapoint at the given index in the model. | |
QBrush | brush (int dataset) const |
Retrieve the brush to be used for the given dataset. | |
QBrush | brush () const |
Retrieve the brush to be used for painting datapoints globally. | |
virtual PieDiagram * | clone () const |
int | columnCount () const |
bool | compare (const AbstractDiagram *other) const |
Returns true if both diagrams have the same settings. | |
AbstractCoordinatePlane * | coordinatePlane () const |
The coordinate plane associated with the diagram. | |
const QPair< QPointF, QPointF > | dataBoundaries () const |
Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these values). | |
virtual void | dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight) |
[reimplemented] | |
QList< QBrush > | datasetBrushes () const |
The set of dataset brushes currently used, for use in legends, etc. | |
int | datasetDimension () const |
The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to have. | |
QStringList | datasetLabels () const |
The set of dataset labels currently displayed, for use in legends, etc. | |
QList< MarkerAttributes > | datasetMarkers () const |
The set of dataset markers currently used, for use in legends, etc. | |
QList< QPen > | datasetPens () const |
The set of dataset pens currently used, for use in legends, etc. | |
DataValueAttributes | dataValueAttributes (const QModelIndex &index) const |
Retrieve the DataValueAttributes for the given index. | |
DataValueAttributes | dataValueAttributes (int column) const |
Retrieve the DataValueAttributes for the given dataset. | |
DataValueAttributes | dataValueAttributes () const |
Retrieve the DataValueAttributes speficied globally. | |
virtual void | doItemsLayout () |
[reimplemented] | |
qreal | granularity () const |
virtual int | horizontalOffset () const |
[reimplemented] | |
virtual QModelIndex | indexAt (const QPoint &point) const |
[reimplemented] | |
bool | isHidden (const QModelIndex &index) const |
Retrieve the hidden status for the given index. | |
bool | isHidden (int column) const |
Retrieve the hidden status for the given dataset. | |
bool | isHidden () const |
Retrieve the hidden status speficied globally. | |
virtual bool | isIndexHidden (const QModelIndex &index) const |
[reimplemented] | |
QStringList | itemRowLabels () const |
The set of item row labels currently displayed, for use in Abscissa axes, etc. | |
virtual QModelIndex | moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers) |
[reimplemented] | |
virtual double | numberOfGridRings () const |
[reimplemented] | |
virtual double | numberOfValuesPerDataset () const |
[reimplemented] | |
void | paintDataValueText (QPainter *painter, const QModelIndex &index, const QPointF &pos, double value) |
void | paintMarker (QPainter *painter, const QModelIndex &index, const QPointF &pos) |
virtual void | paintMarker (QPainter *painter, const MarkerAttributes &markerAttributes, const QBrush &brush, const QPen &, const QPointF &point, const QSizeF &size) |
QPen | pen (const QModelIndex &index) const |
Retrieve the pen to be used, for painting the datapoint at the given index in the model. | |
QPen | pen (int dataset) const |
Retrieve the pen to be used for the given dataset. | |
QPen | pen () const |
Retrieve the pen to be used for painting datapoints globally. | |
bool | percentMode () const |
PieAttributes | pieAttributes (const QModelIndex &index) const |
PieAttributes | pieAttributes (int column) const |
PieAttributes | pieAttributes () const |
PieDiagram (QWidget *parent=0, PolarCoordinatePlane *plane=0) | |
const PolarCoordinatePlane * | polarCoordinatePlane () const |
virtual void | resize (const QSizeF &area) |
[reimplemented] | |
virtual void | scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible) |
[reimplemented] | |
void | setAllowOverlappingDataValueTexts (bool allow) |
Set whether data value labels are allowed to overlap. | |
void | setAntiAliasing (bool enabled) |
Set whether anti-aliasing is to be used while rendering this diagram. | |
virtual void | setAttributesModel (AttributesModel *model) |
Associate an AttributesModel with this diagram. | |
void | setBrush (const QBrush &brush) |
Set the brush to be used, for painting all datasets in the model. | |
void | setBrush (int dataset, const QBrush &brush) |
Set the brush to be used, for painting the given dataset. | |
void | setBrush (const QModelIndex &index, const QBrush &brush) |
Set the brush to be used, for painting the datapoint at the given index. | |
virtual void | setCoordinatePlane (AbstractCoordinatePlane *plane) |
Set the coordinate plane associated with the diagram. | |
void | setDatasetDimension (int dimension) |
Sets the dataset dimension of the diagram. | |
void | setDataValueAttributes (const DataValueAttributes &a) |
Set the DataValueAttributes for all datapoints in the model. | |
void | setDataValueAttributes (int dataset, const DataValueAttributes &a) |
Set the DataValueAttributes for the given dataset. | |
void | setDataValueAttributes (const QModelIndex &index, const DataValueAttributes &a) |
Set the DataValueAttributes for the given index. | |
void | setGranularity (qreal value) |
Set the granularity: the smaller the granularity the more your diagram segments will show facettes instead of rounded segments. | |
void | setHidden (bool hidden) |
Hide (or unhide, resp.) all datapoints in the model. | |
void | setHidden (int column, bool hidden) |
Hide (or unhide, resp.) a dataset. | |
void | setHidden (const QModelIndex &index, bool hidden) |
Hide (or unhide, resp.) a data cell. | |
virtual void | setModel (QAbstractItemModel *model) |
Associate a model with the diagram. | |
void | setPen (const QPen &pen) |
Set the pen to be used, for painting all datasets in the model. | |
void | setPen (int dataset, const QPen &pen) |
Set the pen to be used, for painting the given dataset. | |
void | setPen (const QModelIndex &index, const QPen &pen) |
Set the pen to be used, for painting the datapoint at the given index. | |
void | setPercentMode (bool percent) |
void | setPieAttributes (int column, const PieAttributes &a) |
void | setPieAttributes (const PieAttributes &a) |
virtual void | setRootIndex (const QModelIndex &idx) |
Set the root index in the model, where the diagram starts referencing data for display. | |
virtual void | setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command) |
[reimplemented] | |
void | setStartPosition (int degrees) |
void | setThreeDPieAttributes (const QModelIndex &index, const ThreeDPieAttributes &a) |
void | setThreeDPieAttributes (int column, const ThreeDPieAttributes &a) |
void | setThreeDPieAttributes (const ThreeDPieAttributes &a) |
int | startPosition () const |
ThreeDPieAttributes | threeDPieAttributes (const QModelIndex &index) const |
ThreeDPieAttributes | threeDPieAttributes (int column) const |
ThreeDPieAttributes | threeDPieAttributes () const |
void | update () const |
void | useDefaultColors () |
Set the palette to be used, for painting datasets to the default palette. | |
void | useRainbowColors () |
Set the palette to be used, for painting datasets to the rainbow palette. | |
virtual bool | usesExternalAttributesModel () const |
Returns whether the diagram is using its own built-in attributes model or an attributes model that was set via setAttributesModel. | |
void | useSubduedColors () |
Set the palette to be used, for painting datasets to the subdued palette. | |
virtual double | valueTotals () const |
[reimplemented] | |
virtual int | verticalOffset () const |
[reimplemented] | |
virtual QRect | visualRect (const QModelIndex &index) const |
[reimplemented] | |
virtual QRegion | visualRegionForSelection (const QItemSelection &selection) const |
[reimplemented] | |
virtual | ~PieDiagram () |
Protected Member Functions | |
QModelIndex | attributesModelRootIndex () const |
virtual const QPair< QPointF, QPointF > | calculateDataBoundaries () const |
[reimplemented] | |
virtual bool | checkInvariants (bool justReturnTheStatus=false) const |
QModelIndex | columnToIndex (int column) const |
void | dataHidden () |
This signal is emitted, when the hidden status of at least one data cell was (un)set. | |
void | modelsChanged () |
This signal is emitted, when either the model or the AttributesModel is replaced. | |
virtual void | paint (PaintContext *paintContext) |
[reimplemented] | |
virtual void | paintDataValueTexts (QPainter *painter) |
void | paintEvent (QPaintEvent *) |
virtual void | paintMarkers (QPainter *painter) |
void | propertiesChanged () |
Emitted upon change of a property of the Diagram. | |
void | resizeEvent (QResizeEvent *) |
void | setAttributesModelRootIndex (const QModelIndex &) |
void | setDataBoundariesDirty () const |
double | valueForCell (int row, int column) const |
Helper method, retrieving the data value (DisplayRole) for a given row and column. | |
Protected Attributes | |
Q_SIGNALS | __pad0__: void layoutChanged( AbstractDiagram* ) |
|
Definition at line 52 of file KDChartPieDiagram.cpp. Referenced by clone().
00052 : 00053 AbstractPieDiagram( new Private(), parent, plane ) 00054 { 00055 init(); 00056 } |
|
Definition at line 58 of file KDChartPieDiagram.cpp.
00059 { 00060 } |
|
Definition at line 446 of file KDChartAbstractDiagram.cpp. References d.
00450 { |
|
Definition at line 457 of file KDChartAbstractDiagram.cpp. References d. Referenced by KDChart::LineDiagram::paint().
00461 { |
|
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 286 of file KDChartAbstractDiagram.cpp. References d. Referenced by KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), and KDChart::BarDiagram::setBarAttributes().
00287 { 00288 return d->attributesModel; 00289 } |
|
returns a QModelIndex pointing into the AttributesModel that corresponds to the root index of the diagram. Definition at line 310 of file KDChartAbstractDiagram.cpp. References d. Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculateDataBoundaries(), KDChart::LineDiagram::numberOfAbscissaSegments(), KDChart::BarDiagram::numberOfAbscissaSegments(), KDChart::LineDiagram::numberOfOrdinateSegments(), KDChart::BarDiagram::numberOfOrdinateSegments(), KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), and KDChart::AbstractDiagram::valueForCell().
00316 { |
|
Retrieve the brush to be used, for painting the datapoint at the given index in the model.
Definition at line 816 of file KDChartAbstractDiagram.cpp.
00822 : QRect AbstractDiagram::visualRect(const QModelIndex &) const |
|
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.
Definition at line 808 of file KDChartAbstractDiagram.cpp.
00815 { |
|
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 802 of file KDChartAbstractDiagram.cpp. Referenced by paint(), KDChart::LineDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().
00807 { |
|
[reimplemented]
Implements KDChart::AbstractDiagram. Definition at line 71 of file KDChartPieDiagram.cpp. References KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractPolarDiagram::columnCount(), KDChart::PieAttributes::explode(), KDChart::PieAttributes::explodeFactor(), and KDChart::AbstractPieDiagram::pieAttributes().
00072 { 00073 if ( !checkInvariants( true ) ) return QPair<QPointF, QPointF>( QPointF( 0, 0 ), QPointF( 0, 0 ) ); 00074 00075 const PieAttributes attrs( pieAttributes( model()->index( 0, 0, rootIndex() ) ) ); 00076 00077 QPointF bottomLeft ( QPointF( 0, 0 ) ); 00078 QPointF topRight; 00079 // If we explode, we need extra space for the pie slice that has 00080 // the largest explosion distance. 00081 if ( attrs.explode() ) { 00082 const int colCount = columnCount(); 00083 qreal maxExplode = 0.0; 00084 for( int j = 0; j < colCount; ++j ){ 00085 const PieAttributes columnAttrs( pieAttributes( model()->index( 0, j, rootIndex() ) ) ); 00086 maxExplode = qMax( maxExplode, columnAttrs.explodeFactor() ); 00087 } 00088 topRight = QPointF( 1.0+maxExplode, 1.0+maxExplode ); 00089 }else{ 00090 topRight = QPointF( 1.0, 1.0 ); 00091 } 00092 return QPair<QPointF, QPointF> ( bottomLeft, topRight ); 00093 } |
|
Definition at line 930 of file KDChartAbstractDiagram.cpp. References KDChart::AbstractDiagram::coordinatePlane(). Referenced by KDChart::RingDiagram::calculateDataBoundaries(), KDChart::PolarDiagram::calculateDataBoundaries(), calculateDataBoundaries(), KDChart::LineDiagram::calculateDataBoundaries(), KDChart::BarDiagram::calculateDataBoundaries(), KDChart::RingDiagram::paint(), KDChart::PolarDiagram::paint(), paint(), KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), and KDChart::AbstractDiagram::paintMarker().
00930 { 00931 Q_ASSERT_X ( model(), "AbstractDiagram::checkInvariants()", 00932 "There is no usable model set, for the diagram." ); 00933 00934 Q_ASSERT_X ( coordinatePlane(), "AbstractDiagram::checkInvariants()", 00935 "There is no usable coordinate plane set, for the diagram." ); 00936 } 00937 return model() && coordinatePlane(); 00938 } 00939 00940 int AbstractDiagram::datasetDimension( ) const |
|
Definition at line 66 of file KDChartPieDiagram.cpp. References d, and PieDiagram().
00067 { 00068 return new PieDiagram( new Private( *d ) ); 00069 } |
|
Definition at line 60 of file KDChartAbstractPolarDiagram.cpp. References KDChart::AbstractPolarDiagram::numberOfValuesPerDataset(). Referenced by calculateDataBoundaries(), paint(), and valueTotals().
00061 { 00062 return static_cast<int>( numberOfValuesPerDataset() ); 00063 } |
|
Definition at line 317 of file KDChartAbstractDiagram.cpp.
00323 { |
|
Returns true if both diagrams have the same settings.
Definition at line 135 of file KDChartAbstractDiagram.cpp.
00136 { 00137 if( other == this ) return true; 00138 if( ! other ){ 00139 //qDebug() << "AbstractDiagram::compare() cannot compare to Null pointer"; 00140 return false; 00141 } 00142 /* 00143 qDebug() << "\n AbstractDiagram::compare() QAbstractScrollArea:"; 00144 // compare QAbstractScrollArea properties 00145 qDebug() << 00146 ((horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) && 00147 (verticalScrollBarPolicy() == other->verticalScrollBarPolicy())); 00148 qDebug() << "AbstractDiagram::compare() QFrame:"; 00149 // compare QFrame properties 00150 qDebug() << 00151 ((frameShadow() == other->frameShadow()) && 00152 (frameShape() == other->frameShape()) && 00153 (frameWidth() == other->frameWidth()) && 00154 (lineWidth() == other->lineWidth()) && 00155 (midLineWidth() == other->midLineWidth())); 00156 qDebug() << "AbstractDiagram::compare() QAbstractItemView:"; 00157 // compare QAbstractItemView properties 00158 qDebug() << 00159 ((alternatingRowColors() == other->alternatingRowColors()) && 00160 (hasAutoScroll() == other->hasAutoScroll()) && 00161 #if QT_VERSION > 0x040199 00162 (dragDropMode() == other->dragDropMode()) && 00163 (dragDropOverwriteMode() == other->dragDropOverwriteMode()) && 00164 (horizontalScrollMode() == other->horizontalScrollMode ()) && 00165 (verticalScrollMode() == other->verticalScrollMode()) && 00166 #endif 00167 (dragEnabled() == other->dragEnabled()) && 00168 (editTriggers() == other->editTriggers()) && 00169 (iconSize() == other->iconSize()) && 00170 (selectionBehavior() == other->selectionBehavior()) && 00171 (selectionMode() == other->selectionMode()) && 00172 (showDropIndicator() == other->showDropIndicator()) && 00173 (tabKeyNavigation() == other->tabKeyNavigation()) && 00174 (textElideMode() == other->textElideMode())); 00175 qDebug() << "AbstractDiagram::compare() AttributesModel: "; 00176 // compare all of the properties stored in the attributes model 00177 qDebug() << attributesModel()->compare( other->attributesModel() ); 00178 qDebug() << "AbstractDiagram::compare() own:"; 00179 // compare own properties 00180 qDebug() << 00181 ((rootIndex().column() == other->rootIndex().column()) && 00182 (rootIndex().row() == other->rootIndex().row()) && 00183 (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) && 00184 (antiAliasing() == other->antiAliasing()) && 00185 (percentMode() == other->percentMode()) && 00186 (datasetDimension() == other->datasetDimension())); 00187 */ 00188 return // compare QAbstractScrollArea properties 00189 (horizontalScrollBarPolicy() == other->horizontalScrollBarPolicy()) && 00190 (verticalScrollBarPolicy() == other->verticalScrollBarPolicy()) && 00191 // compare QFrame properties 00192 (frameShadow() == other->frameShadow()) && 00193 (frameShape() == other->frameShape()) && 00194 (frameWidth() == other->frameWidth()) && 00195 (lineWidth() == other->lineWidth()) && 00196 (midLineWidth() == other->midLineWidth()) && 00197 // compare QAbstractItemView properties 00198 (alternatingRowColors() == other->alternatingRowColors()) && 00199 (hasAutoScroll() == other->hasAutoScroll()) && 00200 #if QT_VERSION > 0x040199 00201 (dragDropMode() == other->dragDropMode()) && 00202 (dragDropOverwriteMode() == other->dragDropOverwriteMode()) && 00203 (horizontalScrollMode() == other->horizontalScrollMode ()) && 00204 (verticalScrollMode() == other->verticalScrollMode()) && 00205 #endif 00206 (dragEnabled() == other->dragEnabled()) && 00207 (editTriggers() == other->editTriggers()) && 00208 (iconSize() == other->iconSize()) && 00209 (selectionBehavior() == other->selectionBehavior()) && 00210 (selectionMode() == other->selectionMode()) && 00211 (showDropIndicator() == other->showDropIndicator()) && 00212 (tabKeyNavigation() == other->tabKeyNavigation()) && 00213 (textElideMode() == other->textElideMode()) && 00214 // compare all of the properties stored in the attributes model 00215 attributesModel()->compare( other->attributesModel() ) && 00216 // compare own properties 00217 (rootIndex().column() == other->rootIndex().column()) && 00218 (rootIndex().row() == other->rootIndex().row()) && 00219 (allowOverlappingDataValueTexts() == other->allowOverlappingDataValueTexts()) && 00220 (antiAliasing() == other->antiAliasing()) && 00221 (percentMode() == other->percentMode()) && 00222 (datasetDimension() == other->datasetDimension()); 00223 } |
|
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 226 of file KDChartAbstractDiagram.cpp. References d. Referenced by KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractCartesianDiagram::layoutPlanes(), KDChart::PolarDiagram::paint(), KDChart::LineDiagram::paint(), KDChart::BarDiagram::paint(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), and KDChart::AbstractCartesianDiagram::setCoordinatePlane().
00227 { 00228 return d->plane; 00229 } |
|
Return the bottom left and top right data point, that the diagram will display (unless the grid adjusts these values). This method returns a chached 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 231 of file KDChartAbstractDiagram.cpp. References KDChart::AbstractDiagram::calculateDataBoundaries(), and d. Referenced by KDChart::CartesianCoordinatePlane::getRawDataBoundingRectFromDiagrams(), KDChart::PolarCoordinatePlane::layoutDiagrams(), KDChart::LineDiagram::paint(), and KDChart::BarDiagram::paint().
00232 { 00233 if( d->databoundariesDirty ){ 00234 d->databoundaries = calculateDataBoundaries (); 00235 d->databoundariesDirty = false; 00236 } 00237 return d->databoundaries; 00238 } |
|
[reimplemented]
Definition at line 338 of file KDChartAbstractDiagram.cpp. References d.
00338 { 00339 // We are still too dumb to do intelligent updates... 00340 d->databoundariesDirty = true; 00341 scheduleDelayedItemsLayout(); 00342 } 00343 00344 |
|
This signal is emitted, when the hidden status of at least one data cell was (un)set.
|
|
The set of dataset brushes currently used, for use in legends, etc.
Definition at line 894 of file KDChartAbstractDiagram.cpp. Referenced by KDChart::Legend::buildLegend(), KDChart::Legend::datasetCount(), and KDChart::Legend::setBrushesFromDiagram().
00896 { 00897 QBrush brush = qVariantValue<QBrush>( attributesModel()->headerData( i, Qt::Vertical, DatasetBrushRole ) ); 00898 ret << brush; 00899 } 00900 00901 return ret; 00902 } 00903 00904 QList<QPen> AbstractDiagram::datasetPens() const |
|
The dataset dimension of a diagram determines, how many value dimensions it expects each datapoint to have. For each dimension it will expect one column of values in the model. If the dimensionality is 1, automatic values will be used for the abscissa. For example a diagram with the default dimension of 1, will have one column per datapoint (the y values) and will use automatic values for the x axis (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 942 of file KDChartAbstractDiagram.cpp. References d. Referenced by KDChart::LineDiagram::calculateDataBoundaries(), KDChart::LineDiagram::getCellValues(), KDChart::CartesianCoordinatePlane::getDataDimensionsList(), KDChart::LineDiagram::paint(), and KDChart::LineDiagram::setType().
00946 { |
|
The set of dataset labels currently displayed, for use in legends, etc.
Definition at line 882 of file KDChartAbstractDiagram.cpp. Referenced by KDChart::Legend::buildLegend(), and KDChart::Legend::datasetCount().
00883 : " << attributesModel()->columnCount(attributesModelRootIndex()) << "entries"; 00884 const int columnCount = attributesModel()->columnCount(attributesModelRootIndex()); 00885 for( int i = datasetDimension()-1; i < columnCount; i += datasetDimension() ){ 00886 //qDebug() << "dataset label: " << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString(); 00887 ret << attributesModel()->headerData( i, Qt::Horizontal, Qt::DisplayRole ).toString(); 00888 } 00889 return ret; 00890 } 00891 00892 QList<QBrush> AbstractDiagram::datasetBrushes() const |
|
The set of dataset markers currently used, for use in legends, etc.
Definition at line 917 of file KDChartAbstractDiagram.cpp. Referenced by KDChart::Legend::buildLegend().
00919 { 00920 DataValueAttributes a = 00921 qVariantValue<DataValueAttributes>( attributesModel()->headerData( i, Qt::Vertical, DataValueLabelAttributesRole ) ); 00922 const MarkerAttributes &ma = a.markerAttributes(); 00923 ret << ma; 00924 } 00925 return ret; 00926 } 00927 00928 bool AbstractDiagram::checkInvariants( bool justReturnTheStatus ) const |
|
The set of dataset pens currently used, for use in legends, etc.
Definition at line 906 of file KDChartAbstractDiagram.cpp. Referenced by KDChart::Legend::buildLegend().
00908 { 00909 QPen pen = qVariantValue<QPen>( attributesModel()->headerData( i, Qt::Vertical, DatasetPenRole ) ); 00910 ret << pen; 00911 } 00912 return ret; 00913 } 00914 00915 QList<MarkerAttributes> AbstractDiagram::datasetMarkers() 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.
Definition at line 427 of file KDChartAbstractDiagram.cpp.
00433 { |
|
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.
Definition at line 420 of file KDChartAbstractDiagram.cpp.
00426 { |
|
Retrieve the DataValueAttributes speficied globally. This will fall back automatically to the default settings, if there are no specific settings.
Definition at line 414 of file KDChartAbstractDiagram.cpp. Referenced by KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractDiagram::paintMarker().
00419 { |
|
[reimplemented]
Definition at line 329 of file KDChartAbstractDiagram.cpp. References d, and KDChart::AbstractDiagram::update().
00329 { 00330 d->plane->layoutDiagrams(); 00331 update(); 00332 } 00333 QAbstractItemView::doItemsLayout(); 00334 } 00335 00336 void AbstractDiagram::dataChanged( const QModelIndex &topLeft, |
|
Definition at line 69 of file KDChartAbstractPieDiagram.cpp. References d. Referenced by paint().
|
|
[reimplemented]
Definition at line 839 of file KDChartAbstractDiagram.cpp.
00841 { return 0; }
|
|
[reimplemented]
Definition at line 833 of file KDChartAbstractDiagram.cpp.
00835 { return QModelIndex(); }
|
|
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.
Definition at line 386 of file KDChartAbstractDiagram.cpp. |
|
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.
Definition at line 379 of file KDChartAbstractDiagram.cpp.
00385 { |
|
Retrieve the hidden status speficied globally. This will fall back automatically to the default settings ( = not hidden), if there are no specific settings.
Definition at line 373 of file KDChartAbstractDiagram.cpp. Referenced by KDChart::Legend::buildLegend(), KDChart::LineDiagram::paint(), and KDChart::LineDiagram::valueForCellTesting().
00378 { |
|
[reimplemented]
Definition at line 845 of file KDChartAbstractDiagram.cpp.
00847 {} |
|
The set of item row labels currently displayed, for use in Abscissa axes, etc.
Definition at line 870 of file KDChartAbstractDiagram.cpp.
00871 : " << attributesModel()->rowCount(attributesModelRootIndex()) << "entries"; 00872 const int rowCount = attributesModel()->rowCount(attributesModelRootIndex()); 00873 for( int i = 0; i < rowCount; ++i ){ 00874 //qDebug() << "item row label: " << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString(); 00875 ret << attributesModel()->headerData( i, Qt::Vertical, Qt::DisplayRole ).toString(); 00876 } 00877 return ret; 00878 } 00879 00880 QStringList AbstractDiagram::datasetLabels() const |
|
This signal is emitted, when either the model or the AttributesModel is replaced.
Referenced by KDChart::AbstractDiagram::setAttributesModel(), and KDChart::AbstractDiagram::setModel(). |
|
[reimplemented]
Definition at line 836 of file KDChartAbstractDiagram.cpp.
00838 { return 0; }
|
|
[reimplemented]
Implements KDChart::AbstractPolarDiagram. Definition at line 1107 of file KDChartPieDiagram.cpp.
01108 {
01109 return 1;
01110 }
|
|
[reimplemented]
Implements KDChart::AbstractPolarDiagram. Definition at line 1101 of file KDChartPieDiagram.cpp.
01102 {
01103 return model() ? model()->columnCount( rootIndex() ) : 0.0;
01104 }
|
|
[reimplemented]
Implements KDChart::AbstractDiagram. Definition at line 169 of file KDChartPieDiagram.cpp. References KDChart::AbstractDiagram::brush(), buildReferenceRect(), KDChart::AbstractDiagram::checkInvariants(), KDChart::AbstractPolarDiagram::columnCount(), d, KDChart::AbstractThreeDAttributes::depth(), KDChart::PieAttributes::explodeFactor(), KDChart::AbstractPieDiagram::granularity(), KDChart::AbstractThreeDAttributes::isEnabled(), KDChart::PaintContext::painter(), KDChart::AbstractDiagram::pen(), KDChart::AbstractPieDiagram::pieAttributes(), KDChart::AbstractPolarDiagram::polarCoordinatePlane(), KDChart::PaintContext::rectangle(), KDChart::PolarCoordinatePlane::startPosition(), KDChart::AbstractPieDiagram::threeDPieAttributes(), and valueTotals(). Referenced by paintEvent().
00170 { 00171 // note: Not having any data model assigned is no bug 00172 // but we can not draw a diagram then either. 00173 if ( !checkInvariants(true) ) 00174 return; 00175 00176 const PieAttributes attrs( pieAttributes() ); 00177 const ThreeDPieAttributes threeDAttrs( threeDPieAttributes( model()->index( 0, 0, rootIndex() ) ) ); 00178 00179 const int colCount = columnCount(); 00180 00181 QRectF contentsRect( buildReferenceRect( polarCoordinatePlane() ) ); 00182 contentsRect = ctx->rectangle(); 00183 // contentsRect = geometry(); 00184 //qDebug() << contentsRect; 00185 if( contentsRect.isEmpty() ) 00186 return; 00187 00188 DataValueTextInfoList list; 00189 const qreal sum = valueTotals(); 00190 00191 if( sum == 0.0 ) //nothing to draw 00192 return; 00193 00194 d->startAngles.resize( colCount ); 00195 d->angleLens.resize( colCount ); 00196 00197 // compute position 00198 d->size = qMin( contentsRect.width(), contentsRect.height() ); // initial size 00199 00200 // if the pies explode, we need to give them additional space => 00201 // make the basic size smaller 00202 qreal maxExplode = 0.0; 00203 for( int j = 0; j < colCount; ++j ){ 00204 const PieAttributes columnAttrs( pieAttributes( model()->index( 0, j, rootIndex() ) ) ); 00205 maxExplode = qMax( maxExplode, columnAttrs.explodeFactor() ); 00206 } 00207 d->size /= ( 1.0 + 2.0 * maxExplode ); 00208 00209 00210 qreal sizeFor3DEffect = 0.0; 00211 if ( ! threeDAttrs.isEnabled() ) { 00212 00213 qreal x = ( contentsRect.width() == d->size ) ? 0.0 : ( ( contentsRect.width() - d->size ) / 2.0 ); 00214 qreal y = ( contentsRect.height() == d->size ) ? 0.0 : ( ( contentsRect.height() - d->size ) / 2.0 ); 00215 d->position = QRectF( x, y, d->size, d->size ); 00216 d->position.translate( contentsRect.left(), contentsRect.top() ); 00217 } else { 00218 // threeD: width is the maximum possible width; height is 1/2 of that 00219 qreal x = ( contentsRect.width() == d->size ) ? 0.0 : ( ( contentsRect.width() - d->size ) / 2.0 ); 00220 qreal height = d->size; 00221 // make sure that the height plus the threeDheight is not more than the 00222 // available size 00223 if ( threeDAttrs.depth() >= 0.0 ) { 00224 // positive pie height: absolute value 00225 sizeFor3DEffect = threeDAttrs.depth(); 00226 height = d->size - sizeFor3DEffect; 00227 } else { 00228 // negative pie height: relative value 00229 sizeFor3DEffect = - threeDAttrs.depth() / 100.0 * height; 00230 height = d->size - sizeFor3DEffect; 00231 } 00232 qreal y = ( contentsRect.height() == height ) ? 0.0 : ( ( contentsRect.height() - height - sizeFor3DEffect ) / 2.0 ); 00233 00234 d->position = QRectF( contentsRect.left() + x, contentsRect.top() + y, 00235 d->size, height ); 00236 // d->position.moveBy( contentsRect.left(), contentsRect.top() ); 00237 } 00238 00239 const PolarCoordinatePlane * plane = polarCoordinatePlane(); 00240 const qreal sectorsPerValue = 360.0 / sum; 00241 qreal currentValue = plane ? plane->startPosition() : 0.0; 00242 00243 bool atLeastOneValue = false; // guard against completely empty tables 00244 QVariant vValY; 00245 for ( int iColumn = 0; iColumn < colCount; ++iColumn ) { 00246 // is there anything at all at this column? 00247 bool bOK; 00248 const double cellValue = qAbs( model()->data( model()->index( 0, iColumn, rootIndex() ) ) 00249 .toDouble( &bOK ) ); 00250 00251 if( bOK ){ 00252 d->startAngles[ iColumn ] = currentValue; 00253 d->angleLens[ iColumn ] = cellValue * sectorsPerValue; 00254 atLeastOneValue = true; 00255 } else { // mark as non-existent 00256 d->angleLens[ iColumn ] = 0.0; 00257 if ( iColumn > 0.0 ) 00258 d->startAngles[ iColumn ] = d->startAngles[ iColumn - 1 ]; 00259 else 00260 d->startAngles[ iColumn ] = currentValue; 00261 } 00262 //qDebug() << "d->startAngles["<<iColumn<<"] == " << d->startAngles[ iColumn ] 00263 // << " + d->angleLens["<<iColumn<<"]" << d->angleLens[ iColumn ] 00264 // << " = " << d->startAngles[ iColumn ]+d->angleLens[ iColumn ]; 00265 00266 currentValue = d->startAngles[ iColumn ] + d->angleLens[ iColumn ]; 00267 } 00268 00269 // If there was no value at all, bail out, to avoid endless loops 00270 // later on (e.g. in findPieAt()). 00271 if( ! atLeastOneValue ) 00272 return; 00273 00274 00275 // Find the backmost pie which is at +90° and needs to be drawn 00276 // first 00277 int backmostpie = findPieAt( 90, colCount ); 00278 // Find the frontmost pie (at -90°/+270°) that should be drawn last 00279 int frontmostpie = findPieAt( 270, colCount ); 00280 // the right- and the leftmost (only needed in some special cases...) 00281 int rightmostpie = findPieAt( 0, colCount ); 00282 int leftmostpie = findPieAt( 180, colCount ); 00283 00284 00285 int currentLeftPie = backmostpie; 00286 int currentRightPie = backmostpie; 00287 00288 drawOnePie( ctx->painter(), 0, backmostpie, granularity(), sizeFor3DEffect ); 00289 00290 if( backmostpie == frontmostpie ) 00291 { 00292 if( backmostpie == leftmostpie ) 00293 currentLeftPie = findLeftPie( currentLeftPie, colCount ); 00294 if( backmostpie == rightmostpie ) 00295 currentRightPie = findRightPie( currentRightPie, colCount ); 00296 } 00297 while( currentLeftPie != frontmostpie ) 00298 { 00299 if( currentLeftPie != backmostpie ) 00300 drawOnePie( ctx->painter(), 0, currentLeftPie, granularity(), sizeFor3DEffect ); 00301 currentLeftPie = findLeftPie( currentLeftPie, colCount ); 00302 } 00303 while( currentRightPie != frontmostpie ) 00304 { 00305 if( currentRightPie != backmostpie ) 00306 drawOnePie( ctx->painter(), 0, currentRightPie, granularity(), sizeFor3DEffect ); 00307 currentRightPie = findRightPie( currentRightPie, colCount ); 00308 } 00309 00310 // if the backmost pie is not the frontmost pie, we draw the frontmost at last 00311 if( backmostpie != frontmostpie || ! threeDPieAttributes().isEnabled() ) 00312 { 00313 drawOnePie( ctx->painter(), 0, frontmostpie, granularity(), sizeFor3DEffect ); 00314 // else, this gets a bit mor complicated... 00315 } else if( threeDPieAttributes().isEnabled() ) { 00316 drawPieSurface( ctx->painter(), 0, frontmostpie, granularity() ); 00317 const QModelIndex index = model()->index( 0, frontmostpie, rootIndex() ); 00318 QPen pen = this->pen( index ); 00319 ctx->painter()->setRenderHint ( QPainter::Antialiasing ); 00320 ctx->painter()->setBrush( brush( index ) ); 00321 if ( threeDAttrs.isEnabled() ) 00322 pen.setColor( QColor( 0, 0, 0 ) ); 00323 ctx->painter()->setPen( pen ); 00324 00325 qreal startAngle = d->startAngles[ frontmostpie ]; 00326 if( startAngle > 360 ) 00327 startAngle -= 360; 00328 00329 qreal endAngle = startAngle + d->angleLens[ frontmostpie ]; 00330 startAngle = qMax( startAngle, 180.0 ); 00331 00332 drawArcEffectSegment( ctx->painter(), piePosition( 0, frontmostpie), 00333 sizeFor3DEffect, startAngle, endAngle, granularity() ); 00334 } 00335 } |
|
Definition at line 474 of file KDChartAbstractDiagram.cpp. References KDChart::RelativePosition::alignment(), KDChart::TextAttributes::calculatedFont(), d, KDChart::DataValueAttributes::dataLabel(), KDChart::AbstractDiagram::dataValueAttributes(), KDChart::DataValueAttributes::decimalDigits(), KDChart::TextAttributes::isVisible(), KDChart::DataValueAttributes::isVisible(), KDChart::TextAttributes::pen(), KDChart::DataValueAttributes::position(), KDChart::DataValueAttributes::prefix(), KDChart::TextAttributes::rotation(), KDChart::DataValueAttributes::showRepetitiveDataLabels(), KDChart::DataValueAttributes::suffix(), and KDChart::DataValueAttributes::textAttributes(). Referenced by KDChart::RingDiagram::paint(), and KDChart::PolarDiagram::paint().
00476 { 00477 // paint one data series 00478 const DataValueAttributes a( dataValueAttributes(index) ); 00479 if ( !a.isVisible() ) return; 00480 00481 // handle decimal digits 00482 int decimalDigits = a.decimalDigits(); 00483 int decimalPos = QString::number( value ).indexOf( QLatin1Char( '.' ) ); 00484 QString roundedValue; 00485 if ( a.dataLabel().isNull() ) { 00486 if ( decimalPos > 0 && value != 0 ) 00487 roundedValue = roundValues ( value, decimalPos, decimalDigits ); 00488 else 00489 roundedValue = QString::number( value ); 00490 } else 00491 roundedValue = a.dataLabel(); 00492 // handle prefix and suffix 00493 if ( !a.prefix().isNull() ) 00494 roundedValue.prepend( a.prefix() ); 00495 00496 if ( !a.suffix().isNull() ) 00497 roundedValue.append( a.suffix() ); 00498 00499 const TextAttributes ta( a.textAttributes() ); 00500 // FIXME draw the non-text bits, background, etc 00501 if ( ta.isVisible() ) { 00502 00503 QPointF pt( pos ); 00504 /* for debugging: 00505 PainterSaver painterSaver( painter ); 00506 painter->setPen( Qt::black ); 00507 painter->drawLine( pos - QPointF( 1,1), pos + QPointF( 1,1) ); 00508 painter->drawLine( pos - QPointF(-1,1), pos + QPointF(-1,1) ); 00509 */ 00510 00511 // adjust the text start point position, if alignment is not Bottom/Left 00512 const RelativePosition relPos( a.position( value >= 0.0 ) ); 00513 const Qt::Alignment alignBottomLeft = Qt::AlignBottom | Qt::AlignLeft; 00514 const QFont calculatedFont( ta.calculatedFont( d->plane, KDChartEnums::MeasureOrientationMinimum ) ); 00515 //qDebug() << "calculatedFont's point size:" << calculatedFont.pointSizeF(); 00516 if( (relPos.alignment() & alignBottomLeft) != alignBottomLeft ){ 00517 const QRectF boundRect( 00518 d->cachedFontMetrics( calculatedFont, this )->boundingRect( roundedValue ) ); 00519 if( relPos.alignment() & Qt::AlignRight ) 00520 pt.rx() -= boundRect.width(); 00521 else if( relPos.alignment() & Qt::AlignHCenter ) 00522 pt.rx() -= 0.5 * boundRect.width(); 00523 00524 if( relPos.alignment() & Qt::AlignTop ) 00525 pt.ry() += boundRect.height(); 00526 else if( relPos.alignment() & Qt::AlignVCenter ) 00527 pt.ry() += 0.5 * boundRect.height(); 00528 } 00529 00530 // FIXME draw the non-text bits, background, etc 00531 00532 if ( a.showRepetitiveDataLabels() || 00533 pos.x() <= d->lastX || 00534 d->lastRoundedValue != roundedValue ) { 00535 d->lastRoundedValue = roundedValue; 00536 d->lastX = pos.x(); 00537 00538 PainterSaver painterSaver( painter ); 00539 painter->setPen( ta.pen() ); 00540 painter->setFont( calculatedFont ); 00541 painter->translate( pt ); 00542 painter->rotate( ta.rotation() ); 00543 painter->drawText( QPointF(0, 0), roundedValue ); 00544 } 00545 } 00546 } 00547 00548 |
|
Definition at line 576 of file KDChartAbstractDiagram.cpp.
00579 { 00580 for ( int j=0; j< rowCount; ++j ) { 00581 const QModelIndex index = model()->index( j, i, rootIndex() ); 00582 double value = model()->data( index ).toDouble(); 00583 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) ); 00584 paintDataValueText( painter, index, pos, value ); 00585 } 00586 } 00587 } 00588 00589 |
|
Definition at line 96 of file KDChartPieDiagram.cpp. References paint(), KDChart::PaintContext::setPainter(), and KDChart::PaintContext::setRectangle().
00097 { 00098 QPainter painter ( viewport() ); 00099 PaintContext ctx; 00100 ctx.setPainter ( &painter ); 00101 ctx.setRectangle( QRectF ( 0, 0, width(), height() ) ); 00102 paint ( &ctx ); 00103 } |
|
|
Definition at line 614 of file KDChartAbstractDiagram.cpp. References KDChart::MarkerAttributes::markerStyle(). Referenced by KDChart::MarkerLayoutItem::paintIntoRect(), and KDChart::AbstractDiagram::paintMarker().
00618 { 00619 00620 const QPen oldPen( painter->pen() ); 00621 // Pen is used to paint 4Pixels - 1 Pixel - Ring and FastCross types. 00622 // make sure to use the brush color - see above in those cases. 00623 const bool isFourPixels = (markerAttributes.markerStyle() == MarkerAttributes::Marker4Pixels); 00624 if( isFourPixels || (markerAttributes.markerStyle() == MarkerAttributes::Marker1Pixel) ){ 00625 // for high-performance point charts with tiny point markers: 00626 painter->setPen( QPen( brush.color().light() ) ); 00627 if( isFourPixels ){ 00628 const qreal x = pos.x(); 00629 const qreal y = pos.y(); 00630 painter->drawLine( QPointF(x-1.0,y-1.0), 00631 QPointF(x+1.0,y-1.0) ); 00632 painter->drawLine( QPointF(x-1.0,y), 00633 QPointF(x+1.0,y) ); 00634 painter->drawLine( QPointF(x-1.0,y+1.0), 00635 QPointF(x+1.0,y+1.0) ); 00636 } 00637 painter->drawPoint( pos ); 00638 }else{ 00639 PainterSaver painterSaver( painter ); 00640 // we only a solid line surrounding the markers 00641 QPen painterPen( pen ); 00642 painterPen.setStyle( Qt::SolidLine ); 00643 painter->setPen( painterPen ); 00644 painter->setBrush( brush ); 00645 painter->setRenderHint ( QPainter::Antialiasing ); 00646 painter->translate( pos ); 00647 switch ( markerAttributes.markerStyle() ) { 00648 case MarkerAttributes::MarkerCircle: 00649 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2, 00650 maSize.height(), maSize.width()) ); 00651 break; 00652 case MarkerAttributes::MarkerSquare: 00653 { 00654 QRectF rect( 0 - maSize.width()/2, 0 - maSize.height()/2, 00655 maSize.width(), maSize.height() ); 00656 painter->drawRect( rect ); 00657 painter->fillRect( rect, brush.color() ); 00658 break; 00659 } 00660 case MarkerAttributes::MarkerDiamond: 00661 { 00662 QVector <QPointF > diamondPoints; 00663 QPointF top, left, bottom, right; 00664 top = QPointF( 0, 0 - maSize.height()/2 ); 00665 left = QPointF( 0 - maSize.width()/2, 0 ); 00666 bottom = QPointF( 0, maSize.height()/2 ); 00667 right = QPointF( maSize.width()/2, 0 ); 00668 diamondPoints << top << left << bottom << right; 00669 painter->drawPolygon( diamondPoints ); 00670 break; 00671 } 00672 // both handled on top of the method: 00673 case MarkerAttributes::Marker1Pixel: 00674 case MarkerAttributes::Marker4Pixels: 00675 break; 00676 case MarkerAttributes::MarkerRing: 00677 { 00678 painter->setPen( QPen( brush.color() ) ); 00679 painter->setBrush( Qt::NoBrush ); 00680 painter->drawEllipse( QRectF( 0 - maSize.height()/2, 0 - maSize.width()/2, 00681 maSize.height(), maSize.width()) ); 00682 break; 00683 } 00684 case MarkerAttributes::MarkerCross: 00685 { 00686 QRectF rect( maSize.width()*-0.5, maSize.height()*-0.2, 00687 maSize.width(), maSize.height()*0.4 ); 00688 painter->drawRect( rect ); 00689 rect.setTopLeft(QPointF( maSize.width()*-0.2, maSize.height()*-0.5 )); 00690 rect.setSize(QSizeF( maSize.width()*0.4, maSize.height() )); 00691 painter->drawRect( rect ); 00692 break; 00693 } 00694 case MarkerAttributes::MarkerFastCross: 00695 { 00696 QPointF left, right, top, bottom; 00697 left = QPointF( -maSize.width()/2, 0 ); 00698 right = QPointF( maSize.width()/2, 0 ); 00699 top = QPointF( 0, -maSize.height()/2 ); 00700 bottom= QPointF( 0, maSize.height()/2 ); 00701 painter->setPen( QPen( brush.color() ) ); 00702 painter->drawLine( left, right ); 00703 painter->drawLine( top, bottom ); 00704 break; 00705 } 00706 default: 00707 Q_ASSERT_X ( false, "paintMarkers()", 00708 "Type item does not match a defined Marker Type." ); 00709 } 00710 } 00711 painter->setPen( oldPen ); 00712 } 00713 00714 void AbstractDiagram::paintMarkers( QPainter* painter ) |
|
Definition at line 716 of file KDChartAbstractDiagram.cpp.
00719 { 00720 for ( int j=0; j< rowCount; ++j ) { 00721 const QModelIndex index = model()->index( j, i, rootIndex() ); 00722 double value = model()->data( index ).toDouble(); 00723 const QPointF pos = coordinatePlane()->translate( QPointF( j, value ) ); 00724 paintMarker( painter, index, pos ); 00725 } 00726 } 00727 } 00728 00729 |
|
Retrieve the pen to be used, for painting the datapoint at the given index in the model.
Definition at line 770 of file KDChartAbstractDiagram.cpp.
00777 { |
|
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.
Definition at line 762 of file KDChartAbstractDiagram.cpp.
00769 { |
|
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 756 of file KDChartAbstractDiagram.cpp. Referenced by paint(), and KDChart::LineDiagram::paint().
00761 { |
|
Definition at line 468 of file KDChartAbstractDiagram.cpp. References d. Referenced by KDChart::CartesianCoordinatePlane::getDataDimensionsList(). |
|
Definition at line 121 of file KDChartAbstractPieDiagram.cpp. References d, and KDChart::PieAttributesRole.
00122 { 00123 return qVariantValue<PieAttributes>( 00124 d->attributesModel->data( 00125 d->attributesModel->mapFromSource( index ), 00126 PieAttributesRole ) ); 00127 } |
|
Definition at line 113 of file KDChartAbstractPieDiagram.cpp. References d, and KDChart::PieAttributesRole.
00114 { 00115 return qVariantValue<PieAttributes>( 00116 d->attributesModel->data( 00117 d->attributesModel->mapFromSource( columnToIndex( column ) ).column(), 00118 PieAttributesRole ) ); 00119 } |
|
Definition at line 104 of file KDChartAbstractPieDiagram.cpp. References d, and KDChart::PieAttributesRole. Referenced by calculateDataBoundaries(), and paint().
00105 { 00106 return qVariantValue<PieAttributes>( 00107 d->attributesModel->data( PieAttributesRole ) ); 00108 } |
|
Definition at line 55 of file KDChartAbstractPolarDiagram.cpp. References KDChart::AbstractDiagram::coordinatePlane(). Referenced by paint().
00056 { 00057 return dynamic_cast<const PolarCoordinatePlane*>( coordinatePlane() ); 00058 } |
|
Emitted upon change of a property of the Diagram.
Referenced by KDChart::LineDiagram::resetLineAttributes(), KDChart::AbstractDiagram::setDataValueAttributes(), KDChart::LineDiagram::setLineAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), and KDChart::LineDiagram::setType(). |
|
[reimplemented]
Implements KDChart::AbstractDiagram. Definition at line 109 of file KDChartPieDiagram.cpp.
00110 { 00111 } |
|
Definition at line 105 of file KDChartPieDiagram.cpp.
00106 { 00107 } |
|
[reimplemented]
Definition at line 830 of file KDChartAbstractDiagram.cpp.
00832 { return QModelIndex(); }
|
|
Set whether data value labels are allowed to overlap.
Definition at line 440 of file KDChartAbstractDiagram.cpp. References d.
00445 { |
|
Set whether anti-aliasing is to be used while rendering this diagram.
Definition at line 451 of file KDChartAbstractDiagram.cpp. References d.
00456 { |
|
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 explicitely created by the user, and are owned by her. Setting an AttributesModel that is internal to another diagram is an error. Correct:
Wrong:
Definition at line 261 of file KDChartAbstractDiagram.cpp. References d, and KDChart::AbstractDiagram::modelsChanged().
00262 { 00263 if( amodel->sourceModel() != model() ) { 00264 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: " 00265 "Trying to set an attributesmodel which works on a different " 00266 "model than the diagram."); 00267 return; 00268 } 00269 if( qobject_cast<PrivateAttributesModel*>(amodel) ) { 00270 qWarning("KDChart::AbstractDiagram::setAttributesModel() failed: " 00271 "Trying to set an attributesmodel that is private to another diagram."); 00272 return; 00273 } 00274 d->setAttributesModel(amodel); 00275 scheduleDelayedItemsLayout(); 00276 d->databoundariesDirty = true; 00277 emit modelsChanged(); 00278 } |
|
Definition at line 301 of file KDChartAbstractDiagram.cpp. References d. |
|
Set the brush to be used, for painting all datasets in the model.
Definition at line 786 of file KDChartAbstractDiagram.cpp.
00792 { |
|
Set the brush to be used, for painting the given dataset.
Definition at line 793 of file KDChartAbstractDiagram.cpp.
00801 { |
|
Set the brush to be used, for painting the datapoint at the given index.
Definition at line 778 of file KDChartAbstractDiagram.cpp.
00785 { |
|
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 324 of file KDChartAbstractDiagram.cpp. References d. Referenced by KDChart::AbstractCoordinatePlane::addDiagram(), KDChart::AbstractCartesianDiagram::setCoordinatePlane(), and KDChart::AbstractCoordinatePlane::takeDiagram().
00328 { |
|
Definition at line 240 of file KDChartAbstractDiagram.cpp. References d. Referenced by KDChart::BarDiagram::setThreeDBarAttributes(), KDChart::LineDiagram::setThreeDLineAttributes(), KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().
00241 { 00242 d->databoundariesDirty = true; 00243 } |
|
Sets the dataset dimension of the diagram.
Definition at line 947 of file KDChartAbstractDiagram.cpp. References d.
00954 { |
|
Set the DataValueAttributes for all datapoints in the model.
Definition at line 434 of file KDChartAbstractDiagram.cpp. References d.
00439 { |
|
Set the DataValueAttributes for the given dataset.
Definition at line 406 of file KDChartAbstractDiagram.cpp. References d.
00413 { |
|
Set the DataValueAttributes for the given index.
Definition at line 395 of file KDChartAbstractDiagram.cpp. References d, KDChart::DataValueLabelAttributesRole, and KDChart::AbstractDiagram::propertiesChanged().
00395 { 00396 d->attributesModel->setData( 00397 d->attributesModel->mapFromSource( index ), 00398 qVariantFromValue( a ), 00399 DataValueLabelAttributesRole ); 00400 emit propertiesChanged(); 00401 } 00402 00403 |
|
Set the granularity: the smaller the granularity the more your diagram segments will show facettes instead of rounded segments.
Definition at line 64 of file KDChartAbstractPieDiagram.cpp. References d.
00065 { 00066 d->granularity = value; 00067 } |
|
Hide (or unhide, resp.) all datapoints in the model.
Definition at line 365 of file KDChartAbstractDiagram.cpp. References d.
00372 { |
|
Hide (or unhide, resp.) a dataset.
Definition at line 356 of file KDChartAbstractDiagram.cpp. References d.
00364 { |
|
Hide (or unhide, resp.) a data cell.
Definition at line 347 of file KDChartAbstractDiagram.cpp. References d, and KDChart::DataHiddenRole.
00355 { |
|
Associate a model with the diagram.
Definition at line 245 of file KDChartAbstractDiagram.cpp. References d, KDChart::AttributesModel::initFrom(), and KDChart::AbstractDiagram::modelsChanged().
00246 { 00247 QAbstractItemView::setModel( newModel ); 00248 AttributesModel* amodel = new PrivateAttributesModel( newModel, this ); 00249 amodel->initFrom( d->attributesModel ); 00250 d->setAttributesModel(amodel); 00251 scheduleDelayedItemsLayout(); 00252 d->databoundariesDirty = true; 00253 emit modelsChanged(); 00254 } |
|
Set the pen to be used, for painting all datasets in the model.
Definition at line 740 of file KDChartAbstractDiagram.cpp.
00746 { |
|
Set the pen to be used, for painting the given dataset.
Definition at line 747 of file KDChartAbstractDiagram.cpp.
00755 { |
|
Set the pen to be used, for painting the datapoint at the given index.
Definition at line 732 of file KDChartAbstractDiagram.cpp.
00739 { |
|
Definition at line 462 of file KDChartAbstractDiagram.cpp. References d. Referenced by KDChart::LineDiagram::setType(), and KDChart::BarDiagram::setType().
00467 { |
|
Definition at line 94 of file KDChartAbstractPieDiagram.cpp. References d, and KDChart::PieAttributesRole.
00095 { 00096 d->attributesModel->setHeaderData( 00097 column, Qt::Vertical, qVariantFromValue( attrs ), PieAttributesRole ); 00098 emit layoutChanged( this ); 00099 } |
|
Definition at line 88 of file KDChartAbstractPieDiagram.cpp. References d, and KDChart::PieAttributesRole.
00089 { 00090 d->attributesModel->setModelData( qVariantFromValue( attrs ), PieAttributesRole ); 00091 emit layoutChanged( this ); 00092 } |
|
Set the root index in the model, where the diagram starts referencing data for display. [reimplemented] Definition at line 294 of file KDChartAbstractDiagram.cpp. References d. |
|
[reimplemented]
Definition at line 848 of file KDChartAbstractDiagram.cpp.
00850 { return QRegion(); }
|
|
Definition at line 77 of file KDChartAbstractPieDiagram.cpp.
00078 {
00079 qWarning() << "Deprecated AbstractPieDiagram::setStartPosition() called, setting ignored.";
00080 }
|
|
Definition at line 143 of file KDChartAbstractPieDiagram.cpp. References KDChart::ThreeDPieAttributesRole.
00144 {
00145 model()->setData( index, qVariantFromValue( tda ), ThreeDPieAttributesRole );
00146 emit layoutChanged( this );
00147 }
|
|
Definition at line 136 of file KDChartAbstractPieDiagram.cpp. References d, and KDChart::ThreeDPieAttributesRole.
00137 { 00138 d->attributesModel->setHeaderData( 00139 column, Qt::Vertical, qVariantFromValue( tda ), ThreeDPieAttributesRole ); 00140 emit layoutChanged( this ); 00141 } |
|
Definition at line 130 of file KDChartAbstractPieDiagram.cpp. References d, and KDChart::ThreeDPieAttributesRole.
00131 { 00132 d->attributesModel->setModelData( qVariantFromValue( tda ), ThreeDPieAttributesRole ); 00133 emit layoutChanged( this ); 00134 } |
|
Definition at line 82 of file KDChartAbstractPieDiagram.cpp.
00083 { 00084 qWarning() << "Deprecated AbstractPieDiagram::startPosition() called."; 00085 return 0; 00086 } |
|
Definition at line 169 of file KDChartAbstractPieDiagram.cpp. References d, and KDChart::ThreeDPieAttributesRole.
00170 { 00171 return qVariantValue<ThreeDPieAttributes>( 00172 d->attributesModel->data( 00173 d->attributesModel->mapFromSource( index ), 00174 ThreeDPieAttributesRole ) ); 00175 } |
|
Definition at line 161 of file KDChartAbstractPieDiagram.cpp. References d, and KDChart::ThreeDPieAttributesRole.
00162 { 00163 return qVariantValue<ThreeDPieAttributes>( 00164 d->attributesModel->data( 00165 d->attributesModel->mapFromSource( columnToIndex( column ) ).column(), 00166 ThreeDPieAttributesRole ) ); 00167 } |
|
Definition at line 152 of file KDChartAbstractPieDiagram.cpp. References d, and KDChart::ThreeDPieAttributesRole. Referenced by paint().
00153 { 00154 return qVariantValue<ThreeDPieAttributes>( 00155 d->attributesModel->data( ThreeDPieAttributesRole ) ); 00156 } |
|
Definition at line 961 of file KDChartAbstractDiagram.cpp. References d. Referenced by KDChart::AbstractDiagram::doItemsLayout(). |
|
Set the palette to be used, for painting datasets to the default palette.
Definition at line 855 of file KDChartAbstractDiagram.cpp. References d.
00859 { |
|
Set the palette to be used, for painting datasets to the rainbow palette.
Definition at line 865 of file KDChartAbstractDiagram.cpp. References d.
00869 { |
|
Returns whether the diagram is using its own built-in attributes model or an attributes model that was set via setAttributesModel.
Definition at line 280 of file KDChartAbstractDiagram.cpp. References d.
00281 { 00282 return d->usesExternalAttributesModel(); 00283 } |
|
Set the palette to be used, for painting datasets to the subdued palette.
Definition at line 860 of file KDChartAbstractDiagram.cpp. References d.
00864 { |
|
Helper method, retrieving the data value (DisplayRole) for a given row and column.
Definition at line 955 of file KDChartAbstractDiagram.cpp. References KDChart::AbstractDiagram::attributesModelRootIndex(), and d. Referenced by KDChart::LineDiagram::paint().
00960 { |
|
[reimplemented]
Implements KDChart::AbstractPolarDiagram. Definition at line 1089 of file KDChartPieDiagram.cpp. References KDChart::AbstractPolarDiagram::columnCount(). Referenced by paint().
01090 { 01091 const int colCount = columnCount(); 01092 double total = 0.0; 01093 for ( int j = 0; j < colCount; ++j ) { 01094 total += qAbs(model()->data( model()->index( 0, j, rootIndex() ) ).toDouble()); 01095 //qDebug() << model()->data( model()->index( 0, j, rootIndex() ) ).toDouble(); 01096 } 01097 return total; 01098 } |
|
[reimplemented]
Definition at line 842 of file KDChartAbstractDiagram.cpp.
00844 { return true; } |
|
[reimplemented]
Definition at line 825 of file KDChartAbstractDiagram.cpp.
00829 {} |
|
[reimplemented]
Definition at line 851 of file KDChartAbstractDiagram.cpp. |
|
Definition at line 589 of file KDChartAbstractDiagram.h. |