#include <KDChartDataValueAttributes>
The DataValueAttributes group all properties that can be set wrt data value labels and if and how they are displayed. This includes things like the text attributes (font, color), what markers are used, howmany decimal digits are displayed, etc.
Definition at line 58 of file KDChartDataValueAttributes.h.
Public Member Functions | |
BackgroundAttributes | backgroundAttributes () const |
| |
QString | dataLabel () const |
Returns the string displayed instead of the data value label. | |
DataValueAttributes (const DataValueAttributes &) | |
DataValueAttributes () | |
int | decimalDigits () const |
| |
FrameAttributes | frameAttributes () const |
| |
bool | isVisible () const |
| |
MarkerAttributes | markerAttributes () const |
| |
const RelativePosition | negativePosition () const |
Return the relative positioning of the data value labels. | |
bool | operator!= (const DataValueAttributes &other) const |
DataValueAttributes & | operator= (const DataValueAttributes &) |
bool | operator== (const DataValueAttributes &) const |
const RelativePosition | position (bool positive) const |
const RelativePosition | positivePosition () const |
Return the relative positioning of the data value labels. | |
int | powerOfTenDivisor () const |
QString | prefix () const |
Returns the string used as a prefix to the data value text. | |
void | setBackgroundAttributes (const BackgroundAttributes &a) |
Set the background attributes to use for the data value labels area. | |
void | setDataLabel (const QString label) |
display a string label instead of the original data value label Supports HTML code. | |
void | setDecimalDigits (int digits) |
Set how many decimal digits to display when rendering the data value labels. | |
void | setFrameAttributes (const FrameAttributes &a) |
Set the frame attributes to use for the data value labels area. | |
void | setMarkerAttributes (const MarkerAttributes &a) |
Set the marker attributes to use for the data values. | |
void | setNegativePosition (const RelativePosition &relPosition) |
Defines the relative positioning of the data value labels for negative values. | |
void | setPositivePosition (const RelativePosition &relPosition) |
Defines the relative position of the data value labels for positive values. | |
void | setPowerOfTenDivisor (int powerOfTenDivisor) |
These method are planned for future versions of KD Chart, so they are not part of the documented API yet. | |
void | setPrefix (const QString prefix) |
Prepend a prefix string to the data value label. | |
void | setShowOverlappingDataLabels (bool showOverlappingDataLabels) |
Set whether data value texts overlapping other data value texts of the same diagram should be drawn. | |
void | setShowRepetitiveDataLabels (bool showRepetitiveDataLabels) |
Set whether data value labels not different from their predecessors should be drawn. | |
void | setSuffix (const QString suffix) |
Append a suffix string to the data value label. | |
void | setTextAttributes (const TextAttributes &a) |
Set the text attributes to use for the data value labels. | |
void | setVisible (bool visible) |
Set whether data value labels should be displayed. | |
bool | showOverlappingDataLabels () const |
| |
bool | showRepetitiveDataLabels () const |
| |
QString | suffix () const |
Returns the string used as a suffix to the data value text. | |
TextAttributes | textAttributes () const |
| |
~DataValueAttributes () | |
Static Public Member Functions | |
static const DataValueAttributes & | defaultAttributes () |
static const QVariant & | defaultAttributesAsVariant () |
DataValueAttributes::DataValueAttributes | ( | ) |
Definition at line 111 of file KDChartDataValueAttributes.cpp.
00112 : _d( new Private() ) 00113 { 00114 }
DataValueAttributes::DataValueAttributes | ( | const DataValueAttributes & | r | ) |
Definition at line 116 of file KDChartDataValueAttributes.cpp.
00117 : _d( new Private( *r.d ) ) 00118 { 00119 }
DataValueAttributes::~DataValueAttributes | ( | ) |
BackgroundAttributes DataValueAttributes::backgroundAttributes | ( | ) | const |
Definition at line 224 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator<<(), and operator==().
00225 { 00226 return d->backgroundAttributes; 00227 }
QString DataValueAttributes::dataLabel | ( | ) | const |
Returns the string displayed instead of the data value label.
Definition at line 275 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator==().
00276 { 00277 return d->dataLabel; 00278 }
int DataValueAttributes::decimalDigits | ( | ) | const |
Definition at line 245 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator<<(), and operator==().
00246 { 00247 return d->decimalDigits; 00248 }
const DataValueAttributes & DataValueAttributes::defaultAttributes | ( | ) | [static] |
Definition at line 175 of file KDChartDataValueAttributes.cpp.
Referenced by defaultAttributesAsVariant().
00176 { 00177 static const DataValueAttributes theDefaultDataValueAttributes; 00178 return theDefaultDataValueAttributes; 00179 }
const QVariant & DataValueAttributes::defaultAttributesAsVariant | ( | ) | [static] |
Definition at line 182 of file KDChartDataValueAttributes.cpp.
References defaultAttributes().
Referenced by KDChart::AttributesModel::AttributesModel().
00183 { 00184 static const QVariant theDefaultDataValueAttributesVariant = qVariantFromValue(defaultAttributes()); 00185 return theDefaultDataValueAttributesVariant; 00186 }
FrameAttributes DataValueAttributes::frameAttributes | ( | ) | const |
Definition at line 214 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator<<(), and operator==().
00215 { 00216 return d->frameAttributes; 00217 }
bool DataValueAttributes::isVisible | ( | ) | const |
Definition at line 194 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator<<(), operator==(), and KDChart::AbstractDiagram::paintMarker().
00195 { 00196 return d->visible; 00197 }
MarkerAttributes DataValueAttributes::markerAttributes | ( | ) | const |
Definition at line 234 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by KDChart::AbstractDiagram::datasetMarkers(), operator==(), and KDChart::AbstractDiagram::paintMarker().
00235 { 00236 return d->markerAttributes; 00237 }
const RelativePosition DataValueAttributes::negativePosition | ( | ) | const |
Return the relative positioning of the data value labels.
Definition at line 325 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator<<(), and operator==().
00326 { 00327 return d->negativeRelPos; 00328 }
bool KDChart::DataValueAttributes::operator!= | ( | const DataValueAttributes & | other | ) | const |
Definition at line 65 of file KDChartDataValueAttributes.h.
References KDGantt::operator==().
00065 { return !operator==(other); }
DataValueAttributes & DataValueAttributes::operator= | ( | const DataValueAttributes & | r | ) |
Definition at line 121 of file KDChartDataValueAttributes.cpp.
References d.
00122 { 00123 if( this == &r ) 00124 return *this; 00125 00126 *d = *r.d; 00127 00128 return *this; 00129 }
bool DataValueAttributes::operator== | ( | const DataValueAttributes & | r | ) | const |
Definition at line 137 of file KDChartDataValueAttributes.cpp.
References backgroundAttributes(), dataLabel(), decimalDigits(), frameAttributes(), isVisible(), markerAttributes(), negativePosition(), positivePosition(), powerOfTenDivisor(), prefix(), showOverlappingDataLabels(), showRepetitiveDataLabels(), suffix(), and textAttributes().
00138 { 00139 /* 00140 qDebug() << "DataValueAttributes::operator== finds" 00141 << "b" << (isVisible() == r.isVisible()) 00142 << "c" << (textAttributes() == r.textAttributes()) 00143 << "d" << (frameAttributes() == r.frameAttributes()) 00144 << "e" << (backgroundAttributes() == r.backgroundAttributes()) 00145 << "f" << (markerAttributes() == r.markerAttributes()) 00146 << "g" << (decimalDigits() == r.decimalDigits()) 00147 << "h" << (prefix() == r.prefix()) 00148 << "i" << (suffix() == r.suffix()) 00149 << "j" << (dataLabel() == r.dataLabel()) 00150 << "k" << (powerOfTenDivisor() == r.powerOfTenDivisor()) 00151 << "l" << (showInfinite() == r.showInfinite()) 00152 << "m" << (negativePosition() == r.negativePosition()) 00153 << "n" << (positivePosition() == r.positivePosition()) 00154 << "o" << (showRepetitiveDataLabels() == r.showRepetitiveDataLabels()) 00155 << "p" << (showOverlappingDataLabels() == r.showOverlappingDataLabels()); 00156 */ 00157 return ( isVisible() == r.isVisible() && 00158 textAttributes() == r.textAttributes() && 00159 frameAttributes() == r.frameAttributes() && 00160 backgroundAttributes() == r.backgroundAttributes() && 00161 markerAttributes() == r.markerAttributes() && 00162 decimalDigits() == r.decimalDigits() && 00163 prefix() == r.prefix() && 00164 suffix() == r.suffix() && 00165 dataLabel() == r.dataLabel() && 00166 powerOfTenDivisor() == r.powerOfTenDivisor() && 00167 showInfinite() == r.showInfinite() && 00168 negativePosition() == r.negativePosition() && 00169 positivePosition() == r.positivePosition() && 00170 showRepetitiveDataLabels() == r.showRepetitiveDataLabels() && 00171 showOverlappingDataLabels() == r.showOverlappingDataLabels() ); 00172 }
const RelativePosition KDChart::DataValueAttributes::position | ( | bool | positive | ) | const |
Definition at line 269 of file KDChartDataValueAttributes.h.
00270 { 00271 return positive ? positivePosition() : negativePosition(); 00272 }
const RelativePosition DataValueAttributes::positivePosition | ( | ) | const |
Return the relative positioning of the data value labels.
Definition at line 335 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator<<(), and operator==().
00336 { 00337 return d->positiveRelPos; 00338 }
int DataValueAttributes::powerOfTenDivisor | ( | ) | const |
Definition at line 305 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator<<(), and operator==().
00306 { 00307 return d->powerOfTenDivisor; 00308 }
QString DataValueAttributes::prefix | ( | ) | const |
Returns the string used as a prefix to the data value text.
Definition at line 255 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator==().
00256 { 00257 return d->prefix; 00258 }
void DataValueAttributes::setBackgroundAttributes | ( | const BackgroundAttributes & | a | ) |
Set the background attributes to use for the data value labels area.
a | The background attributes to set. |
Definition at line 219 of file KDChartDataValueAttributes.cpp.
References d.
00220 { 00221 d->backgroundAttributes = a; 00222 }
void DataValueAttributes::setDataLabel | ( | const QString | label | ) |
display a string label instead of the original data value label Supports HTML code.
Definition at line 270 of file KDChartDataValueAttributes.cpp.
References d.
00271 { 00272 d->dataLabel = label; 00273 }
void DataValueAttributes::setDecimalDigits | ( | int | digits | ) |
Set how many decimal digits to display when rendering the data value labels.
If there are no decimal digits it will not be displayed.
digits | The number of decimal digits to use. |
Definition at line 240 of file KDChartDataValueAttributes.cpp.
References d.
00241 { 00242 d->decimalDigits = digits; 00243 }
void DataValueAttributes::setFrameAttributes | ( | const FrameAttributes & | a | ) |
Set the frame attributes to use for the data value labels area.
a | The frame attributes to set. |
Definition at line 209 of file KDChartDataValueAttributes.cpp.
References d.
00210 { 00211 d->frameAttributes = a; 00212 }
void DataValueAttributes::setMarkerAttributes | ( | const MarkerAttributes & | a | ) |
Set the marker attributes to use for the data values.
This includes the marker type.
a | The marker attributes to set. |
Definition at line 229 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by KDChart::TernaryLineDiagram::TernaryLineDiagram().
00230 { 00231 d->markerAttributes = a; 00232 }
void DataValueAttributes::setNegativePosition | ( | const RelativePosition & | relPosition | ) |
Defines the relative positioning of the data value labels for negative values.
The position is specified in relation to the respective data value point, or in releation to the respective data representation area, that's one area segment in a LineDiagram showing areas, or one bar in a BarDiagram, one pie slice ...
Definition at line 320 of file KDChartDataValueAttributes.cpp.
References d.
00321 { 00322 d->negativeRelPos = relPosition; 00323 }
void DataValueAttributes::setPositivePosition | ( | const RelativePosition & | relPosition | ) |
Defines the relative position of the data value labels for positive values.
The position is specified in relation to the respective data value point, or in releation to the respective data representation area, that's one area segment in a LineDiagram showing areas, or one bar in a BarDiagram, one pie slice ...
Definition at line 330 of file KDChartDataValueAttributes.cpp.
References d.
00331 { 00332 d->positiveRelPos = relPosition; 00333 }
void DataValueAttributes::setPowerOfTenDivisor | ( | int | powerOfTenDivisor | ) |
These method are planned for future versions of KD Chart, so they are not part of the documented API yet.
Definition at line 300 of file KDChartDataValueAttributes.cpp.
References d.
00301 { 00302 d->powerOfTenDivisor = powerOfTenDivisor; 00303 }
void DataValueAttributes::setPrefix | ( | const QString | prefix | ) |
Prepend a prefix string to the data value label.
Definition at line 250 of file KDChartDataValueAttributes.cpp.
References d.
00251 { 00252 d->prefix = prefixString; 00253 }
void DataValueAttributes::setShowOverlappingDataLabels | ( | bool | showOverlappingDataLabels | ) |
Set whether data value texts overlapping other data value texts of the same diagram should be drawn.
showOverlappingDataLabels | Whether data texts overlapping other data value texts of the same diagram are drawn. |
Definition at line 295 of file KDChartDataValueAttributes.cpp.
References d.
00296 { 00297 d->showOverlappingDataLabels = showOverlappingDataLabels; 00298 }
void DataValueAttributes::setShowRepetitiveDataLabels | ( | bool | showRepetitiveDataLabels | ) |
Set whether data value labels not different from their predecessors should be drawn.
showRepetitiveDataLabels | Whether data value not different from their predecessors are drawn. |
Definition at line 285 of file KDChartDataValueAttributes.cpp.
References d.
00286 { 00287 d->showRepetitiveDataLabels = showRepetitiveDataLabels; 00288 }
void DataValueAttributes::setSuffix | ( | const QString | suffix | ) |
Append a suffix string to the data value label.
Definition at line 260 of file KDChartDataValueAttributes.cpp.
References d.
00261 { 00262 d->suffix = suffixString; 00263 }
void DataValueAttributes::setTextAttributes | ( | const TextAttributes & | a | ) |
Set the text attributes to use for the data value labels.
a | The text attributes to set. |
Definition at line 199 of file KDChartDataValueAttributes.cpp.
References d.
00200 { 00201 d->textAttributes = a; 00202 }
void DataValueAttributes::setVisible | ( | bool | visible | ) |
Set whether data value labels should be displayed.
visible | Whether data value labels should be displayed. |
Definition at line 189 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by KDChart::TernaryLineDiagram::TernaryLineDiagram().
00190 { 00191 d->visible = visible; 00192 }
bool DataValueAttributes::showOverlappingDataLabels | ( | ) | const |
Definition at line 290 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator<<(), and operator==().
00291 { 00292 return d->showOverlappingDataLabels; 00293 }
bool DataValueAttributes::showRepetitiveDataLabels | ( | ) | const |
Definition at line 280 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator<<(), and operator==().
00281 { 00282 return d->showRepetitiveDataLabels; 00283 }
QString DataValueAttributes::suffix | ( | ) | const |
Returns the string used as a suffix to the data value text.
Definition at line 265 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator==().
00266 { 00267 return d->suffix; 00268 }
TextAttributes DataValueAttributes::textAttributes | ( | ) | const |
Definition at line 204 of file KDChartDataValueAttributes.cpp.
References d.
Referenced by operator<<(), and operator==().
00205 { 00206 return d->textAttributes; 00207 }