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 ),
86 positiveRelPos.setAlignment( Qt::AlignTop | Qt::AlignRight );
87 negativeRelPos.setAlignment( Qt::AlignBottom | Qt::AlignRight );
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()
QString prefix() const
Returns the string used as a prefix to the data value text.
void setDecimalDigits(int digits)
Set how many decimal digits to display when rendering the data value labels.
bool mirrorNegativeValueTextRotation() const
If true, rotation of negative value labels is negated, so that negative values are rotated in opposit...
void setMirrorNegativeValueTextRotation(bool enable)
MarkerAttributes markerAttributes() const
void setVisible(bool visible)
Set whether data value labels should be displayed.
Diagram attributes dealing with data value labels.
void setFrameAttributes(const FrameAttributes &a)
Set the frame attributes to use for the data value labels area.
QString dataLabel() const
Returns the string displayed instead of the data value label.
bool usePercentage() const
BackgroundAttributes backgroundAttributes() const
static const DataValueAttributes & defaultAttributes()
Declaring the class KDChart::DataValueAttributes.
A set of attributes for frames around items.
bool showOverlappingDataLabels() const
void setMarkerAttributes(const MarkerAttributes &a)
Set the marker attributes to use for the data values.
void setDataLabel(const QString label)
display a string label instead of the original data value label Supports HTML code.
bool showRepetitiveDataLabels() const
static const Position & Unknown
int decimalDigits() const
static const QVariant & defaultAttributesAsVariant()
void setRotation(int rotation)
Set the rotation angle to use for the text.
void setPositivePosition(const RelativePosition &relPosition)
Defines the relative position of the data value labels for positive values.
void setPrefix(const QString prefix)
Prepend a prefix string to the data value label.
#define KDCHART_DATA_VALUE_AUTO_DIGITS
void setFontSize(const Measure &measure)
Set the size of the font used for rendering text.
void setTextAttributes(const TextAttributes &a)
Set the text attributes to use for the data value labels.
void setUsePercentage(bool enable)
Specify whether to use percentages instead of actual data point values when no specific label is set...
const RelativePosition positivePosition() const
Return the relative positioning of the data value labels.
void setShowRepetitiveDataLabels(bool showRepetitiveDataLabels)
Set whether data value labels not different from their predecessors should be drawn.
TextAttributes textAttributes() const
DataValueAttributes & operator=(const DataValueAttributes &)
void setBackgroundAttributes(const BackgroundAttributes &a)
Set the background attributes to use for the data value labels area.
bool operator==(const DataValueAttributes &) const
A set of attributes controlling the appearance of data set markers.
void setShowOverlappingDataLabels(bool showOverlappingDataLabels)
Set whether data value texts overlapping other data value texts of the same diagram should be drawn...
void setSuffix(const QString suffix)
Append a suffix string to the data value label.
Measure is used to specify relative and absolute sizes in KDChart, e.g.
QString suffix() const
Returns the string used as a suffix to the data value text.
Defines relative position information: reference area, position in this area (reference position)...
void setMinimalFontSize(const Measure &measure)
Set the minimal size of the font used for rendering text.
QDebug operator<<(QDebug stream, const DataDimension &r)
void setCalculationMode(KDChartEnums::MeasureCalculationMode mode)
void setNegativePosition(const RelativePosition &relPosition)
Defines the relative positioning of the data value labels for negative values.
const RelativePosition negativePosition() const
Return the relative positioning of the data value labels.
FrameAttributes frameAttributes() const
A set of text attributes.
Set of attributes usable for background pixmaps.