KDChart::DataValueAttributes Class Reference

#include <KDChartDataValueAttributes>

List of all members.


Detailed Description

Diagram attributes dealing with data value labels.

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
 
Returns:
The background attributes used for painting the data value labels area.

QString dataLabel () const
 Returns the string displayed instead of the data value label.
 DataValueAttributes (const DataValueAttributes &)
 DataValueAttributes ()
int decimalDigits () const
 
Returns:
The number of decimal digits displayed.

FrameAttributes frameAttributes () const
 
Returns:
The frame attributes used for painting the data value labels area.

bool isVisible () const
 
Returns:
Whether data value labels should be displayed.

MarkerAttributes markerAttributes () const
 
Returns:
The marker attributes used for decorating the data values.

const RelativePosition negativePosition () const
 Return the relative positioning of the data value labels.
bool operator!= (const DataValueAttributes &other) const
DataValueAttributesoperator= (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.
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 setPrefix (const QString prefix)
 Prepend a prefix string to the data value label.
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.
QString suffix () const
 Returns the string used as a suffix to the data value text.
TextAttributes textAttributes () const
 
Returns:
The text attributes used for painting data value labels.

 ~DataValueAttributes ()

Static Public Member Functions

static const DataValueAttributesdefaultAttributes ()
static const QVariant & defaultAttributesAsVariant ()


Constructor & Destructor Documentation

DataValueAttributes::DataValueAttributes (  ) 

Definition at line 106 of file KDChartDataValueAttributes.cpp.

00107     : _d( new Private() )
00108 {
00109 }

DataValueAttributes::DataValueAttributes ( const DataValueAttributes  ) 

Definition at line 111 of file KDChartDataValueAttributes.cpp.

00112     : _d( new Private( *r.d ) )
00113 {
00114 }

DataValueAttributes::~DataValueAttributes (  ) 

Definition at line 126 of file KDChartDataValueAttributes.cpp.

00127 {
00128     delete _d; _d = 0;
00129 }


Member Function Documentation

BackgroundAttributes DataValueAttributes::backgroundAttributes (  )  const

Returns:
The background attributes used for painting the data value labels area.

See also:
BackgroundAttributes

Definition at line 217 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator<<(), and operator==().

00218 {
00219     return d->backgroundAttributes;
00220 }

QString DataValueAttributes::dataLabel (  )  const

Returns the string displayed instead of the data value label.

See also:
setDataLabel

Definition at line 268 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator==(), and KDChart::AbstractDiagram::paintDataValueText().

00269 {
00270     return d->dataLabel;
00271 }

int DataValueAttributes::decimalDigits (  )  const

Returns:
The number of decimal digits displayed.

Definition at line 238 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator<<(), operator==(), and KDChart::AbstractDiagram::paintDataValueText().

00239 {
00240     return d->decimalDigits;
00241 }

const DataValueAttributes & DataValueAttributes::defaultAttributes (  )  [static]

Definition at line 168 of file KDChartDataValueAttributes.cpp.

Referenced by defaultAttributesAsVariant().

00169 {
00170     static const DataValueAttributes theDefaultDataValueAttributes;
00171     return theDefaultDataValueAttributes;
00172 }

const QVariant & DataValueAttributes::defaultAttributesAsVariant (  )  [static]

Definition at line 175 of file KDChartDataValueAttributes.cpp.

References defaultAttributes().

Referenced by KDChart::AttributesModel::AttributesModel().

00176 {
00177     static const QVariant theDefaultDataValueAttributesVariant = qVariantFromValue(defaultAttributes());
00178     return theDefaultDataValueAttributesVariant;
00179 }

FrameAttributes DataValueAttributes::frameAttributes (  )  const

Returns:
The frame attributes used for painting the data value labels area.

See also:
FrameAttributes

Definition at line 207 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator<<(), and operator==().

00208 {
00209     return d->frameAttributes;
00210 }

bool DataValueAttributes::isVisible (  )  const

Returns:
Whether data value labels should be displayed.

Definition at line 187 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator<<(), operator==(), KDChart::AbstractDiagram::paintDataValueText(), and KDChart::AbstractDiagram::paintMarker().

00188 {
00189     return d->visible;
00190 }

MarkerAttributes DataValueAttributes::markerAttributes (  )  const

Returns:
The marker attributes used for decorating the data values.

See also:
MarkerAttributes

Definition at line 227 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator==(), and KDChart::AbstractDiagram::paintMarker().

00228 {
00229     return d->markerAttributes;
00230 }

const RelativePosition DataValueAttributes::negativePosition (  )  const

Return the relative positioning of the data value labels.

See also:
setNegativePosition

Definition at line 308 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator<<(), and operator==().

00309 {
00310     return d->negativeRelPos;
00311 }

bool KDChart::DataValueAttributes::operator!= ( const DataValueAttributes other  )  const

Definition at line 65 of file KDChartDataValueAttributes.h.

00065 { return !operator==(other); }

DataValueAttributes & DataValueAttributes::operator= ( const DataValueAttributes  ) 

Definition at line 116 of file KDChartDataValueAttributes.cpp.

References d.

00117 {
00118     if( this == &r )
00119         return *this;
00120 
00121     *d = *r.d;
00122 
00123     return *this;
00124 }

bool DataValueAttributes::operator== ( const DataValueAttributes  )  const

Definition at line 132 of file KDChartDataValueAttributes.cpp.

References backgroundAttributes(), dataLabel(), decimalDigits(), frameAttributes(), isVisible(), markerAttributes(), negativePosition(), positivePosition(), prefix(), suffix(), and textAttributes().

00133 {
00134     /*
00135     qDebug() << "DataValueAttributes::operator== finds"
00136             << "b" << (isVisible() == r.isVisible())
00137             << "c" << (textAttributes() == r.textAttributes())
00138             << "d" << (frameAttributes() == r.frameAttributes())
00139             << "e" << (backgroundAttributes() == r.backgroundAttributes())
00140             << "f" << (markerAttributes() == r.markerAttributes())
00141             << "g" << (decimalDigits() == r.decimalDigits())
00142             << "h" << (prefix() == r.prefix())
00143             << "i" << (suffix() == r.suffix())
00144             << "j" << (dataLabel() == r.dataLabel())
00145             << "k" << (powerOfTenDivisor() == r.powerOfTenDivisor())
00146             << "l" << (showInfinite() == r.showInfinite())
00147             << "m" << (negativePosition() == r.negativePosition())
00148             << "n" << (positivePosition() == r.positivePosition())
00149             << "o" << (showRepetitiveDataLabels() == r.showRepetitiveDataLabels());
00150     */
00151     return ( isVisible() == r.isVisible() &&
00152             textAttributes() == r.textAttributes() &&
00153             frameAttributes() == r.frameAttributes() &&
00154             backgroundAttributes() == r.backgroundAttributes() &&
00155             markerAttributes() == r.markerAttributes() &&
00156             decimalDigits() == r.decimalDigits() &&
00157             prefix() == r.prefix() &&
00158             suffix() == r.suffix() &&
00159             dataLabel() == r.dataLabel() &&
00160             powerOfTenDivisor() == r.powerOfTenDivisor() &&
00161             showInfinite() == r.showInfinite() &&
00162             negativePosition() == r.negativePosition() &&
00163             positivePosition() == r.positivePosition() &&
00164             showRepetitiveDataLabels() == r.showRepetitiveDataLabels() );
00165 }

const RelativePosition KDChart::DataValueAttributes::position ( bool  positive  )  const

Definition at line 259 of file KDChartDataValueAttributes.h.

Referenced by KDChart::AbstractDiagram::paintDataValueText().

00260   {
00261     return positive ? positivePosition() : negativePosition();
00262   }

const RelativePosition DataValueAttributes::positivePosition (  )  const

Return the relative positioning of the data value labels.

See also:
setPositivePosition

Definition at line 318 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator<<(), and operator==().

00319 {
00320     return d->positiveRelPos;
00321 }

QString DataValueAttributes::prefix (  )  const

Returns the string used as a prefix to the data value text.

See also:
setPrefix

Definition at line 248 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator==(), and KDChart::AbstractDiagram::paintDataValueText().

00249 {
00250     return d->prefix;
00251 }

void DataValueAttributes::setBackgroundAttributes ( const BackgroundAttributes a  ) 

Set the background attributes to use for the data value labels area.

Parameters:
a The background attributes to set.
See also:
BackgroundAttributes

Definition at line 212 of file KDChartDataValueAttributes.cpp.

References d.

00213 {
00214     d->backgroundAttributes = a;
00215 }

void DataValueAttributes::setDataLabel ( const QString  label  ) 

display a string label instead of the original data value label Supports HTML code.

See also:
dataLabel

Definition at line 263 of file KDChartDataValueAttributes.cpp.

References d.

00264 {
00265     d->dataLabel =  label;
00266 }

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.

Parameters:
digits The number of decimal digits to use.

Definition at line 233 of file KDChartDataValueAttributes.cpp.

References d.

00234 {
00235     d->decimalDigits = digits;
00236 }

void DataValueAttributes::setFrameAttributes ( const FrameAttributes a  ) 

Set the frame attributes to use for the data value labels area.

Parameters:
a The frame attributes to set.
See also:
FrameAttributes

Definition at line 202 of file KDChartDataValueAttributes.cpp.

References d.

00203 {
00204     d->frameAttributes = a;
00205 }

void DataValueAttributes::setMarkerAttributes ( const MarkerAttributes a  ) 

Set the marker attributes to use for the data values.

This includes the marker type.

Parameters:
a The marker attributes to set.
See also:
MarkerAttributes

Definition at line 222 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by KDChart::TernaryLineDiagram::TernaryLineDiagram().

00223 {
00224     d->markerAttributes = a;
00225 }

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 ...

See also:
negativePosition

Definition at line 303 of file KDChartDataValueAttributes.cpp.

References d.

00304 {
00305     d->negativeRelPos = relPosition;
00306 }

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 ...

See also:
positivePosition

Definition at line 313 of file KDChartDataValueAttributes.cpp.

References d.

00314 {
00315     d->positiveRelPos = relPosition;
00316 }

void DataValueAttributes::setPrefix ( const QString  prefix  ) 

Prepend a prefix string to the data value label.

See also:
prefix

Definition at line 243 of file KDChartDataValueAttributes.cpp.

References d.

00244 {
00245     d->prefix = prefixString;
00246 }

void DataValueAttributes::setSuffix ( const QString  suffix  ) 

Append a suffix string to the data value label.

See also:
suffix

Definition at line 253 of file KDChartDataValueAttributes.cpp.

References d.

00254 {
00255     d->suffix  = suffixString;
00256 }

void DataValueAttributes::setTextAttributes ( const TextAttributes a  ) 

Set the text attributes to use for the data value labels.

Parameters:
a The text attributes to set.
See also:
TextAttributes

Definition at line 192 of file KDChartDataValueAttributes.cpp.

References d.

00193 {
00194     d->textAttributes = a;
00195 }

void DataValueAttributes::setVisible ( bool  visible  ) 

Set whether data value labels should be displayed.

Parameters:
visible Whether data value labels should be displayed.

Definition at line 182 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by KDChart::TernaryLineDiagram::TernaryLineDiagram().

00183 {
00184     d->visible = visible;
00185 }

QString DataValueAttributes::suffix (  )  const

Returns the string used as a suffix to the data value text.

See also:
setSuffix

Definition at line 258 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator==(), and KDChart::AbstractDiagram::paintDataValueText().

00259 {
00260     return d->suffix;
00261 }

TextAttributes DataValueAttributes::textAttributes (  )  const

Returns:
The text attributes used for painting data value labels.

Definition at line 197 of file KDChartDataValueAttributes.cpp.

References d.

Referenced by operator<<(), operator==(), and KDChart::AbstractDiagram::paintDataValueText().

00198 {
00199     return d->textAttributes;
00200 }


The documentation for this class was generated from the following files:
Generated on Mon Sep 17 16:18:16 2007 for KD Chart 2 by  doxygen 1.5.1