34 #include <KDABLibFakes>
37 #define KDCHART_DATA_VALUE_AUTO_DIGITS 4
42 using namespace KDChart;
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()