 |
KD Chart 2
[rev.2.8]
|
Go to the documentation of this file.
34 #include <KDABLibFakes>
37 #define KDCHART_DATA_VALUE_AUTO_DIGITS 4
44 class DataValueAttributes::Private
60 qint16 powerOfTenDivisor;
62 bool showInfinite : 1;
69 DataValueAttributes::Private::Private() :
71 powerOfTenDivisor( 0 ),
76 textAttributes.setFontSize( me );
79 textAttributes.setMinimalFontSize( me );
80 textAttributes.setRotation( -45 );
86 positiveRelPos.setAlignment( Qt::AlignTop | Qt::AlignRight );
87 negativeRelPos.setAlignment( Qt::AlignBottom | Qt::AlignRight );
89 showRepetitiveDataLabels =
false;
90 showOverlappingDataLabels =
false;
92 usePercentage =
false;
93 mirrorNegativeValueTextRotation =
false;
97 DataValueAttributes::DataValueAttributes()
103 : _d( new Private( *r.
d ) )
134 powerOfTenDivisor() == r.powerOfTenDivisor() &&
135 showInfinite() == r.showInfinite() &&
148 return theDefaultDataValueAttributes;
154 static const QVariant theDefaultDataValueAttributesVariant = qVariantFromValue(
defaultAttributes());
155 return theDefaultDataValueAttributesVariant;
161 d->visible = visible;
171 d->textAttributes = a;
176 return d->textAttributes;
181 d->frameAttributes = a;
186 return d->frameAttributes;
191 d->backgroundAttributes = a;
196 return d->backgroundAttributes;
201 d->markerAttributes = a;
206 return d->markerAttributes;
211 d->mirrorNegativeValueTextRotation = enable;
216 return d->mirrorNegativeValueTextRotation;
221 d->usePercentage = enable;
226 return d->usePercentage;
231 d->decimalDigits = digits;
236 return d->decimalDigits;
241 d->prefix = prefixString;
251 d->suffix = suffixString;
261 d->dataLabel = label;
271 return d->showRepetitiveDataLabels;
281 return d->showOverlappingDataLabels;
289 void DataValueAttributes::setPowerOfTenDivisor(
int powerOfTenDivisor )
291 d->powerOfTenDivisor = powerOfTenDivisor;
294 int DataValueAttributes::powerOfTenDivisor()
const
296 return d->powerOfTenDivisor;
299 void DataValueAttributes::setShowInfinite(
bool infinite )
301 d->showInfinite = infinite;
304 bool DataValueAttributes::showInfinite()
const
306 return d->showInfinite;
311 d->negativeRelPos = relPosition;
316 return d->negativeRelPos;
321 d->positiveRelPos = relPosition;
326 return d->positiveRelPos;
329 #if !defined(QT_NO_DEBUG_STREAM)
332 dbg <<
"RelativePosition DataValueAttributes("
338 <<
"poweroftendivisor="<<val.powerOfTenDivisor()
339 <<
"showinfinite="<<val.showInfinite()
const RelativePosition negativePosition() const
Return the relative positioning of the data value labels.
A set of attributes controlling the appearance of data set markers.
void setShowRepetitiveDataLabels(bool showRepetitiveDataLabels)
Set whether data value labels not different from their predecessors should be drawn.
bool showRepetitiveDataLabels() const
int decimalDigits() const
@ MeasureCalculationModeAuto
static const QVariant & defaultAttributesAsVariant()
FrameAttributes frameAttributes() const
MarkerAttributes markerAttributes() const
BackgroundAttributes backgroundAttributes() const
bool operator==(const DataValueAttributes &) const
QString prefix() const
Returns the string used as a prefix to the data value text.
void setSuffix(const QString suffix)
Append a suffix string to the data value label.
QString suffix() const
Returns the string used as a suffix to the data value text.
void setBackgroundAttributes(const BackgroundAttributes &a)
Set the background attributes to use for the data value labels area.
void setShowOverlappingDataLabels(bool showOverlappingDataLabels)
Set whether data value texts overlapping other data value texts of the same diagram should be drawn.
bool usePercentage() const
void setFrameAttributes(const FrameAttributes &a)
Set the frame attributes to use for the data value labels area.
QDebug operator<<(QDebug stream, const DataDimension &r)
A set of text attributes.
Measure is used to specify relative and absolute sizes in KDChart, e.g.
void setMirrorNegativeValueTextRotation(bool enable)
const RelativePosition positivePosition() const
Return the relative positioning of the data value labels.
void setNegativePosition(const RelativePosition &relPosition)
Defines the relative positioning of the data value labels for negative values.
Defines relative position information: reference area, position in this area (reference position),...
@ MeasureCalculationModeAbsolute
Set of attributes usable for background pixmaps.
void setDecimalDigits(int digits)
Set how many decimal digits to display when rendering the data value labels.
bool showOverlappingDataLabels() const
void setDataLabel(const QString label)
display a string label instead of the original data value label Supports HTML code.
DataValueAttributes & operator=(const DataValueAttributes &)
A set of attributes for frames around items.
void setMarkerAttributes(const MarkerAttributes &a)
Set the marker attributes to use for the data values.
#define KDCHART_DATA_VALUE_AUTO_DIGITS
Declaring the class KDChart::DataValueAttributes.
TextAttributes textAttributes() const
void setUsePercentage(bool enable)
Specify whether to use percentages instead of actual data point values when no specific label is set.
QString dataLabel() const
Returns the string displayed instead of the data value label.
void setPrefix(const QString prefix)
Prepend a prefix string to the data value label.
void setVisible(bool visible)
Set whether data value labels should be displayed.
static const DataValueAttributes & defaultAttributes()
Diagram attributes dealing with data value labels.
void setPositivePosition(const RelativePosition &relPosition)
Defines the relative position of the data value labels for positive values.
void setTextAttributes(const TextAttributes &a)
Set the text attributes to use for the data value labels.
bool mirrorNegativeValueTextRotation() const
If true, rotation of negative value labels is negated, so that negative values are rotated in opposit...