22 #include <KDABLibFakes>
25 #define KDCHART_DATA_VALUE_AUTO_DIGITS 4
31 class DataValueAttributes::Private
49 qint16 powerOfTenDivisor = 0;
51 bool showInfinite : 1;
58 DataValueAttributes::Private::Private()
63 textAttributes.setFontSize(me);
66 textAttributes.setMinimalFontSize(me);
67 textAttributes.setRotation(-45);
73 positiveRelPos.setAlignment(Qt::AlignTop | Qt::AlignRight);
74 negativeRelPos.setAlignment(Qt::AlignBottom | Qt::AlignRight);
76 showRepetitiveDataLabels =
false;
77 showOverlappingDataLabels =
false;
79 usePercentage =
false;
80 mirrorNegativeValueTextRotation =
false;
83 DataValueAttributes::DataValueAttributes()
89 : _d(new Private(*r.
d))
118 return theDefaultDataValueAttributes;
124 static const QVariant theDefaultDataValueAttributesVariant = QVariant::fromValue(
defaultAttributes());
125 return theDefaultDataValueAttributesVariant;
130 d->visible = visible;
140 d->textAttributes = a;
145 return d->textAttributes;
150 d->frameAttributes = a;
155 return d->frameAttributes;
160 d->backgroundAttributes = a;
165 return d->backgroundAttributes;
170 d->markerAttributes = a;
175 return d->markerAttributes;
180 d->mirrorNegativeValueTextRotation = enable;
185 return d->mirrorNegativeValueTextRotation;
190 d->usePercentage = enable;
195 return d->usePercentage;
200 d->decimalDigits = digits;
205 return d->decimalDigits;
210 d->prefix = prefixString;
220 d->suffix = suffixString;
230 d->dataLabel = label;
240 return d->showRepetitiveDataLabels;
250 return d->showOverlappingDataLabels;
258 void DataValueAttributes::setPowerOfTenDivisor(
int powerOfTenDivisor)
260 d->powerOfTenDivisor = powerOfTenDivisor;
263 int DataValueAttributes::powerOfTenDivisor()
const
265 return d->powerOfTenDivisor;
268 void DataValueAttributes::setShowInfinite(
bool infinite)
270 d->showInfinite = infinite;
273 bool DataValueAttributes::showInfinite()
const
275 return d->showInfinite;
280 d->negativeRelPos = relPosition;
285 return d->negativeRelPos;
290 d->positiveRelPos = relPosition;
295 return d->positiveRelPos;
298 #if !defined(QT_NO_DEBUG_STREAM)
301 dbg <<
"RelativePosition DataValueAttributes("
307 <<
"poweroftendivisor=" << val.powerOfTenDivisor()
308 <<
"showinfinite=" << val.showInfinite()
#define KDCHART_DATA_VALUE_AUTO_DIGITS
Declaring the class KDChart::DataValueAttributes.
@ MeasureCalculationModeAbsolute
@ MeasureCalculationModeAuto
Diagram attributes dealing with data value labels.
void setPrefix(const QString &prefix)
Prepend a prefix string to the data value label.
void setMirrorNegativeValueTextRotation(bool enable)
void setFrameAttributes(const FrameAttributes &a)
const RelativePosition positivePosition() const
Return the relative positioning of the data value labels.
void setDecimalDigits(int digits)
bool operator==(const DataValueAttributes &) const
void setMarkerAttributes(const MarkerAttributes &a)
void setPositivePosition(const RelativePosition &relPosition)
Defines the relative position of the data value labels for positive values.
DataValueAttributes & operator=(const DataValueAttributes &)
void setUsePercentage(bool enable)
MarkerAttributes markerAttributes() const
bool usePercentage() const
int decimalDigits() const
const RelativePosition negativePosition() const
Return the relative positioning of the data value labels.
bool showOverlappingDataLabels() const
void setSuffix(const QString &suffix)
Append a suffix string to the data value label.
FrameAttributes frameAttributes() const
BackgroundAttributes backgroundAttributes() const
void setBackgroundAttributes(const BackgroundAttributes &a)
bool mirrorNegativeValueTextRotation() const
static const QVariant & defaultAttributesAsVariant()
TextAttributes textAttributes() const
void setDataLabel(const QString &label)
display a string label instead of the original data value label Supports HTML code.
QString prefix() const
Returns the string used as a prefix to the data value text.
bool showRepetitiveDataLabels() const
void setShowOverlappingDataLabels(bool showOverlappingDataLabels)
void setTextAttributes(const TextAttributes &a)
void setNegativePosition(const RelativePosition &relPosition)
Defines the relative positioning of the data value labels for negative values.
void setVisible(bool visible)
static const DataValueAttributes & defaultAttributes()
QString suffix() const
Returns the string used as a suffix to the data value text.
QString dataLabel() const
Returns the string displayed instead of the data value label.
void setShowRepetitiveDataLabels(bool showRepetitiveDataLabels)
A set of attributes for frames around items.
A set of attributes controlling the appearance of data set markers.
Measure is used to specify relative and absolute sizes in KDChart, e.g. font sizes.
Defines relative position information: reference area, position in this area (reference position),...
A set of text attributes.
QDebug operator<<(QDebug stream, const DataDimension &r)