KD Chart 2: KDChartEnums class Reference

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# KDChartEnums Class Reference

`#include <KDChartEnums.h>`

Inheritance diagram for KDChartEnums:

[legend]
Collaboration diagram for KDChartEnums:
[legend]
List of all members.

## Detailed Description

Project global class providing some enums needed both by KDChartParams and by KDChartCustomBox.

Definition at line 46 of file KDChartEnums.h.

## Public Types
enum | GranularitySequence { GranularitySequence_10_20, GranularitySequence_10_50, GranularitySequence_25_50, GranularitySequence_125_25, GranularitySequenceIrregular }
| GranularitySequence specifies the values, that may be applied, to determine a step width within a given data range. More...
enum | MeasureCalculationMode { MeasureCalculationModeAbsolute, MeasureCalculationModeRelative, MeasureCalculationModeAuto, MeasureCalculationModeAutoArea, MeasureCalculationModeAutoOrientation }
| Measure calculation mode: the way how the absolute value of a KDChart::Measure is determined during KD Chart's internal geometry calculation time. More...
enum | MeasureOrientation { MeasureOrientationAuto, MeasureOrientationHorizontal, MeasureOrientationVertical, MeasureOrientationMinimum, MeasureOrientationMaximum }
| Measure orientation mode: the way how the absolute value of a KDChart::Measure is determined during KD Chart's internal geometry calculation time. More...
enum | PositionValue { PositionUnknown = 0, PositionCenter = 1, PositionNorthWest = 2, PositionNorth = 3, PositionNorthEast = 4, PositionEast = 5, PositionSouthEast = 6, PositionSouth = 7, PositionSouthWest = 8, PositionWest = 9, PositionFloating = 10 }
| Numerical values of the static KDChart::Position instances, for using a Position::value() with a switch() statement. More...
enum | TextLayoutPolicy { LayoutJustOverwrite, LayoutPolicyRotate, LayoutPolicyShiftVertically, LayoutPolicyShiftHorizontally, LayoutPolicyShrinkFontSize }
| Text layout policy: what to do if text that is to be drawn would cover neighboring text or neighboring areas. More...
## Static Public Member Functions
QString | granularitySequenceToString (GranularitySequence sequence)
| Converts the specified granularity sequence enum to a string representation.
QString | layoutPolicyToString (TextLayoutPolicy type)
| Converts the specified text layout policy enum to a string representation.
QString | measureCalculationModeToString (MeasureCalculationMode mode)
| Converts the specified measure calculation mode enum to a string representation.
QString | measureOrientationToString (MeasureOrientation mode)
| Converts the specified measure orientation enum to a string representation.
GranularitySequence | stringToGranularitySequence (const QString &string)
| Converts the specified string to a granularity sequence enum value.
TextLayoutPolicy | stringToLayoutPolicy (const QString &string)
| Converts the specified string to a text layout policy enum value.
MeasureCalculationMode | stringToMeasureCalculationMode (const QString &string)
| Converts the specified string to a measure calculation mode enum value.
MeasureOrientation | stringToMeasureOrientation (const QString &string)
| Converts the specified string to a measure orientation enum value.

## Member Enumeration Documentation

enum KDChartEnums::GranularitySequence

  | GranularitySequence specifies the values, that may be applied, to determine a step width within a given data range. Note: Granularity with can be set for Linear axis calculation mode only, there is no way to specify a step width for Logarithmic axes. Value occuring in the GranularitySequence names only are showing their respective relation ship. For real data they will most times not be used directly, but be multiplied by positive (or negative, resp.) powers of ten. A granularity sequence is a sequence of values from the following set: 1, 1.25, 2, 2.5, 5. The reason for using one of the following three pre-defined granularity sequences (instead of just using the best matching step width) is to follow a simple rule: If scaling becomes finer (== smaller step width) no value, that has been on a grid line before, shall loose its line and be NOT on a grid line anymore! This means: Smaller step width may not remove any grid lines, but it may add additional lines in between. `GranularitySequence_10_20` Step widths can be 1, or 2, but they never can be 2.5 nor 5, nor 1.25. `GranularitySequence_10_50` Step widths can be 1, or 5, but they never can be 2, nor 2.5, nor 1.25. `GranularitySequence_25_50` Step widths can be 2.5, or 5, but they never can be 1, nor 2, nor 1.25. `GranularitySequence_125_25` Step widths can be 1.25 or 2.5 but they never can be 1, nor 2, nor 5. `GranularitySequenceIrregular` Step widths can be all of these values: 1, or 1.25, or 2, or 2.5, or 5. Note: When ever possible, try to avoid using GranularitySequenceIrregular! Allowing all possible step values, using this granularity sequence involves a serious risk: Your users might be irritated due to 'jumping' grid lines, when step size is changed from 2.5 to 2 (or vice versa, resp.). In case you still want to use GranularitySequenceIrregular just make sure to NOT draw any sub-grid lines, because in most cases you will get not-matching step widths for the sub-grid. In short: GranularitySequenceIrregular can safely be used if your data range is not changing at all AND (b) you will not allow the coordinate plane to be zoomed AND (c) you are not displaying any sub-grid lines. Since you probably like having the value 1 as an allowed step width, the granularity sequence decision boils down to a boolean question: To get ten divided by five you use GranularitySequence_10_20, while for having it divided by two GranularitySequence_10_50 is your choice. Enumeration values:
  GranularitySequence_10_20 |
  GranularitySequence_10_50 |
  GranularitySequence_25_50 |
  GranularitySequence_125_25 |
  GranularitySequenceIrregular |
Definition at line 101 of file KDChartEnums.h.
    00101                              {
    00102         GranularitySequence_10_20,
    00103         GranularitySequence_10_50,
    00104         GranularitySequence_25_50,
    00105         GranularitySequence_125_25,
    00106         GranularitySequenceIrregular };

enum KDChartEnums::MeasureCalculationMode

  | Measure calculation mode: the way how the absolute value of a KDChart::Measure is determined during KD Chart's internal geometry calculation time. KDChart::Measure values either are relative (calculated in relation to a given AbstractArea), or they are absolute (used as fixed values). Values stored in relative measure always are interpreted as per-mille of a reference area's height (or width, resp.) depending on the orientation set for the KDChart::Measure. `MeasureCalculationModeAbsolute` Value set by setValue() is absolute, to be used unchanged. `MeasureCalculationModeRelative` Value is relative, the reference area is specified by setReferenceArea(), and orientation specified by setOrientation(). `MeasureCalculationModeAuto` Value is relative, KD Chart will automatically determine which reference area to use, and it will determine the orientation too. `MeasureCalculationModeAutoArea` Value is relative, Orientation is specified by setOrientation(), and KD Chart will automatically determine which reference area to use. `MeasureCalculationModeAutoOrientation` Value is relative, Area is specified by setReferenceArea(), and KD Chart will automatically determine which orientation to use. See also: KDChart::Measure::setCalculationMode Enumeration values:
  MeasureCalculationModeAbsolute |
  MeasureCalculationModeRelative |
  MeasureCalculationModeAuto |
  MeasureCalculationModeAutoArea |
  MeasureCalculationModeAutoOrientation |
Definition at line 229 of file KDChartEnums.h.
    00229                                 { MeasureCalculationModeAbsolute,
    00230         MeasureCalculationModeRelative,
    00231         MeasureCalculationModeAuto,
    00232         MeasureCalculationModeAutoArea,
    00233         MeasureCalculationModeAutoOrientation };

enum KDChartEnums::MeasureOrientation

  | Measure orientation mode: the way how the absolute value of a KDChart::Measure is determined during KD Chart's internal geometry calculation time. KDChart::Measure values either are relative (calculated in relation to a given AbstractArea), or they are absolute (used as fixed values). Values stored in relative measure take into account the width (and/or the height, resp.) of a so-called reference area, that is either specified by KDChart::Measure::setReferenceArea, or determined by KD Chart automatically, respectively. `MeasureOrientationAuto` Value is calculated, based upon the width (or on the height, resp.) of the reference area: KD Chart will automatically determie an appropriate way. `MeasureOrientationHorizontal` Value is calculated, based upon the width of the reference area. `MeasureOrientationVertical` Value is calculated, based upon the height of the reference area. `MeasureOrientationMinimum` Value is calculated, based upon the width (or on the height, resp.) of the reference area - which ever is smaller. `MeasureOrientationMaximum` Value is calculated, based upon the width (or on the height, resp.) of the reference area - which ever is smaller. See also: KDChart::Measure::setOrientationMode Enumeration values:
  MeasureOrientationAuto |
  MeasureOrientationHorizontal |
  MeasureOrientationVertical |
  MeasureOrientationMinimum |
  MeasureOrientationMaximum |
Definition at line 298 of file KDChartEnums.h.
    00298                             { MeasureOrientationAuto,
    00299         MeasureOrientationHorizontal,
    00300         MeasureOrientationVertical,
    00301         MeasureOrientationMinimum,
    00302         MeasureOrientationMaximum };

enum KDChartEnums::PositionValue

  | Numerical values of the static KDChart::Position instances, for using a Position::value() with a switch() statement. See also: Position Enumeration values:
  PositionUnknown |
  PositionCenter |
  PositionNorthWest |
  PositionNorth |
  PositionNorthEast |
  PositionEast |
  PositionSouthEast |
  PositionSouth |
  PositionSouthWest |
  PositionWest |
  PositionFloating |
Definition at line 199 of file KDChartEnums.h.
    00199                        {
    00200         PositionUnknown   = 0,
    00201         PositionCenter    = 1,
    00202         PositionNorthWest = 2,
    00203         PositionNorth     = 3,
    00204         PositionNorthEast = 4,
    00205         PositionEast      = 5,
    00206         PositionSouthEast = 6,
    00207         PositionSouth     = 7,
    00208         PositionSouthWest = 8,
    00209         PositionWest      = 9,
    00210         PositionFloating  =10
    00211     };

enum KDChartEnums::TextLayoutPolicy

  | Text layout policy: what to do if text that is to be drawn would cover neighboring text or neighboring areas. `LayoutJustOverwrite` Just ignore the layout collision and write the text nevertheless. `LayoutPolicyRotate` Try counter-clockwise rotation to make the text fit into the space. `LayoutPolicyShiftVertically` Shift the text baseline upwards (or downwards, resp.) and draw a connector line between the text and its anchor. `LayoutPolicyShiftHorizontally` Shift the text baseline to the left (or to the right, resp.) and draw a connector line between the text and its anchor. `LayoutPolicyShrinkFontSize` Reduce the text font size. See also: KDChartParams::setPrintDataValues Enumeration values:
  LayoutJustOverwrite |
  LayoutPolicyRotate |
  LayoutPolicyShiftVertically |
  LayoutPolicyShiftHorizontally |
  LayoutPolicyShrinkFontSize |
Definition at line 168 of file KDChartEnums.h.
    00168                           { LayoutJustOverwrite,
    00169         LayoutPolicyRotate,
    00170         LayoutPolicyShiftVertically,
    00171         LayoutPolicyShiftHorizontally,
    00172         LayoutPolicyShrinkFontSize };

## Member Function Documentation

QString KDChartEnums::granularitySequenceToString | ( | GranularitySequence | sequence | ) | `[static]`

  | Converts the specified granularity sequence enum to a string representation. Parameters:
  type | the granularity sequence enum to convert
Returns: the string representation of the granularity sequence Definition at line 115 of file KDChartEnums.h.
    00115                                                                                {
    00116         switch( sequence ) {
    00117             case GranularitySequence_10_20:
    00118                 return QString::fromLatin1("GranularitySequence_10_20");
    00119             case GranularitySequence_10_50:
    00120                 return QString::fromLatin1("GranularitySequence_10_50");
    00121             case GranularitySequence_25_50:
    00122                 return QString::fromLatin1("GranularitySequence_25_50");
    00123             case GranularitySequence_125_25:
    00124                 return QString::fromLatin1("GranularitySequence_125_25");
    00125             case GranularitySequenceIrregular:
    00126                 return QString::fromLatin1("GranularitySequenceIrregular");
    00127             default: // should not happen
    00128         qDebug( "Unknown granularity sequence" );
    00129         return QString::fromLatin1("GranularitySequence_10_20");
    00130         }
    00131     }

QString KDChartEnums::layoutPolicyToString | ( | TextLayoutPolicy | type | ) | `[static]`

  | Converts the specified text layout policy enum to a string representation. Parameters:
  type | the text layout policy to convert
Returns: the string representation of the text layout policy enum

QString KDChartEnums::measureCalculationModeToString | ( | MeasureCalculationMode | mode | ) | `[static]`

  | Converts the specified measure calculation mode enum to a string representation. Parameters:
  type | the measure calculation mode to convert
Returns: the string representation of the Measure calculation mode enum Definition at line 242 of file KDChartEnums.h.
    00242                                                                                  {
    00243         switch( mode ) {
    00244             case MeasureCalculationModeAbsolute:
    00245                 return QString::fromLatin1("MeasureCalculationModeAbsolute");
    00246             case MeasureCalculationModeAuto:
    00247                 return QString::fromLatin1("MeasureCalculationModeAuto");
    00248             case MeasureCalculationModeAutoArea:
    00249                 return QString::fromLatin1("MeasureCalculationModeAutoArea");
    00250             case MeasureCalculationModeAutoOrientation:
    00251                 return QString::fromLatin1("MeasureCalculationModeAutoOrientation");
    00252             case MeasureCalculationModeRelative:
    00253                 return QString::fromLatin1("MeasureCalculationModeRelative");
    00254             default: // should not happen
    00255         qDebug( "Unknown measure calculation mode" );
    00256         return QString::fromLatin1("MeasureCalculationModeAuto");
    00257         }
    00258     }

QString KDChartEnums::measureOrientationToString | ( | MeasureOrientation | mode | ) | `[static]`

  | Converts the specified measure orientation enum to a string representation. Parameters:
  type | the measure orientation to convert
Returns: the string representation of the measure orientation enum Definition at line 311 of file KDChartEnums.h.
    00311                                                                          {
    00312         switch( mode ) {
    00313             case MeasureOrientationAuto:
    00314                 return QString::fromLatin1("MeasureOrientationAuto");
    00315             case MeasureOrientationHorizontal:
    00316                 return QString::fromLatin1("MeasureOrientationHorizontal");
    00317             case MeasureOrientationVertical:
    00318                 return QString::fromLatin1("MeasureOrientationVertical");
    00319             case MeasureOrientationMinimum:
    00320                 return QString::fromLatin1("MeasureOrientationMinimum");
    00321             case MeasureOrientationMaximum:
    00322                 return QString::fromLatin1("MeasureOrientationMaximum");
    00323             default: // should not happen
    00324         qDebug( "Unknown measure orientation mode" );
    00325         return QString::fromLatin1("MeasureOrientationAuto");
    00326         }
    00327     }

GranularitySequence KDChartEnums::stringToGranularitySequence | ( | const QString & | string | ) | `[static]`

  | Converts the specified string to a granularity sequence enum value. Parameters:
  string | the string to convert
Returns: the granularity sequence enum value Definition at line 140 of file KDChartEnums.h.
    00140                                                                                     {
    00141       if( string == QString::fromLatin1("GranularitySequence_10_20") )
    00142           return GranularitySequence_10_20;
    00143       if( string == QString::fromLatin1("GranularitySequence_10_50") )
    00144           return GranularitySequence_10_50;
    00145       if( string == QString::fromLatin1("GranularitySequence_25_50") )
    00146           return GranularitySequence_25_50;
    00147       if( string == QString::fromLatin1("GranularitySequence_125") )
    00148           return GranularitySequence_125_25;
    00149       if( string == QString::fromLatin1("GranularitySequenceIrregular") )
    00150           return GranularitySequenceIrregular;
    00151       // default, should not happen
    00152       return GranularitySequence_10_20;
    00153     }

TextLayoutPolicy KDChartEnums::stringToLayoutPolicy | ( | const QString & | string | ) | `[static]`

  | Converts the specified string to a text layout policy enum value. Parameters:
  string | the string to convert
Returns: the text layout policy enum value

MeasureCalculationMode KDChartEnums::stringToMeasureCalculationMode | ( | const QString & | string | ) | `[static]`

  | Converts the specified string to a measure calculation mode enum value. Parameters:
  string | the string to convert
Returns: the measure calculation mode enum value Definition at line 267 of file KDChartEnums.h.
    00267                                                                                           {
    00268       if( string == QString::fromLatin1("MeasureCalculationModeAbsolute") )
    00269           return MeasureCalculationModeAbsolute;
    00270       if( string == QString::fromLatin1("MeasureCalculationModeAuto") )
    00271           return MeasureCalculationModeAuto;
    00272       if( string == QString::fromLatin1("MeasureCalculationModeAutoArea") )
    00273           return MeasureCalculationModeAutoArea;
    00274       if( string == QString::fromLatin1("MeasureCalculationModeAutoOrientation") )
    00275           return MeasureCalculationModeAutoOrientation;
    00276       if( string == QString::fromLatin1("MeasureCalculationModeRelative") )
    00277           return MeasureCalculationModeRelative;
    00278       // default, should not happen
    00279       return MeasureCalculationModeAuto;
    00280     }

MeasureOrientation KDChartEnums::stringToMeasureOrientation | ( | const QString & | string | ) | `[static]`

  | Converts the specified string to a measure orientation enum value. Parameters:
  string | the string to convert
Returns: the measure orientation enum value Definition at line 336 of file KDChartEnums.h.
    00336                                                                                   {
    00337       if( string == QString::fromLatin1("MeasureOrientationAuto") )
    00338           return MeasureOrientationAuto;
    00339       if( string == QString::fromLatin1("MeasureOrientationHorizontal") )
    00340           return MeasureOrientationHorizontal;
    00341       if( string == QString::fromLatin1("MeasureOrientationVertical") )
    00342           return MeasureOrientationVertical;
    00343       if( string == QString::fromLatin1("MeasureOrientationMinimum") )
    00344           return MeasureOrientationMinimum;
    00345       if( string == QString::fromLatin1("MeasureOrientationMaximum") )
    00346           return MeasureOrientationMaximum;
    00347       // default, should not happen
    00348       return MeasureOrientationAuto;
    00349     }

The documentation for this class was generated from the following file:

- KDChartEnums.h