Logo Search packages:      
Sourcecode: koffice version File versions

KDChartParams.h

Go to the documentation of this file.
/* -*- Mode: C++ -*-
   KDChart - a multi-platform charting engine
   */

/****************************************************************************
 ** Copyright (C) 2001-2003 Klarälvdalens Datakonsult AB.  All rights reserved.
 **
 ** This file is part of the KDChart library.
 **
 ** This file may be distributed and/or modified under the terms of the
 ** GNU General Public License version 2 as published by the Free Software
 ** Foundation and appearing in the file LICENSE.GPL included in the
 ** packaging of this file.
 **
 ** Licensees holding valid commercial KDChart licenses may use this file in
 ** accordance with the KDChart Commercial License Agreement provided with
 ** the Software.
 **
 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 **
 ** See http://www.klaralvdalens-datakonsult.se/?page=products for
 **   information about KDChart Commercial License Agreements.
 **
 ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
 ** licensing are not clear to you.
 **
 **********************************************************************/
#ifndef __KDCHARTPARAMS_H__
#define __KDCHARTPARAMS_H__

#include <qapplication.h>
#include <qfont.h>
#include <qcolor.h>
#include <qpen.h>
#include <qmap.h>
#include <qobject.h>
#include <qtextstream.h>
#include <qsimplerichtext.h>
#include <qdom.h>
#include <limits.h>

#include <math.h>
#ifdef Q_WS_WIN
#define M_PI 3.14159265358979323846
#endif

#include "KDChartGlobal.h"
#include "KDChartEnums.h"
#include "KDChartCustomBox.h"
#include "KDFrame.h"
#include "KDChartData.h"
#include "KDChartAxisParams.h"
#include "KDChartPropertySet.h"

#if COMPAT_QT_VERSION >= 0x030000
#include <qvaluevector.h>
#else
#include <qarray.h>
#endif

/** \file KDChartParams.h
  \brief Header for all common chart parameters.

  This file is used to access all chart parameters except of the
  axis settings which you will find in \c KDChartAxisParams.h

  \see KDChartAxisParams.h
  */


typedef QMap < int, KDChartPropertySet > KDChartPropertySetList;


00075 class KDChartParams : public QObject
{
    Q_OBJECT

    public:
        // GENERAL

        static const uint KDCHART_ALL_AXES;
        static const uint KDCHART_NO_AXIS;
        static const uint KDCHART_ALL_DATASETS;
        static const uint KDCHART_NO_DATASET;
        static const uint KDCHART_UNKNOWN_CHART;
        static const uint KDCHART_ALL_CHARTS;
        static const uint KDCHART_NO_CHART;

        static const int DATA_VALUE_AUTO_DIGITS;

        static const int SAGITTAL_ROTATION;
        static const int TANGENTIAL_ROTATION;

00095         static const int KDCHART_PROPSET_NORMAL_DATA;
00096         static const int KDCHART_PROPSET_TRANSPARENT_DATA;
00097         static const int KDCHART_PROPSET_HORI_LINE;
00098         static const int KDCHART_PROPSET_VERT_LINE;

        static QColor* const DATA_VALUE_AUTO_COLOR;

00102         static const int KDCHART_CNT_ORDINATES;


        /* we must keep this wrongly spelled value for backward compatibility reasons */
        static const int SAGGITAL_ROTATION;


#define MAX_POLAR_DELIMS_AND_LABELS_POS 8
00110 #define KDCHART_MAX_AXES 12


00113         void setOptimizeOutputForScreen( bool screenOutput )
        {
            _optimizeOutputForScreen = screenOutput;
        }


00119         bool optimizeOutputForScreen() const
        {
            return _optimizeOutputForScreen;
        }

        void setGlobalLeading( int left, int top, int right, int bottom );

00126         void setGlobalLeadingLeft( int leading )
        {
            _globalLeadingLeft = leading;
            emit changed();
        }
00131         void setGlobalLeadingTop( int leading )
        {
            _globalLeadingTop = leading;
            emit changed();
        }
00136         void setGlobalLeadingRight( int leading )
        {
            _globalLeadingRight = leading;
            emit changed();
        }
00141         void setGlobalLeadingBottom( int leading )
        {
            _globalLeadingBottom = leading;
            emit changed();
        }
00146         int globalLeadingLeft() const
        {
            return _globalLeadingLeft;
        }
00150         int globalLeadingTop() const
        {
            return _globalLeadingTop;
        }
00154         int globalLeadingRight() const
        {
            return _globalLeadingRight;
        }
00158         int globalLeadingBottom() const
        {
            return _globalLeadingBottom;
        }

        int registerProperties( KDChartPropertySet& rSet );
        bool setProperties( int id, KDChartPropertySet& rSet );
        bool removeProperties( int id );
        bool properties( int id, KDChartPropertySet& rSet ) const;
        bool calculateProperties( int startId, KDChartPropertySet& rSet ) const;
00168         class KDChartFrameSettings
        {
            public:
                KDChartFrameSettings();
                KDChartFrameSettings( uint           dataRow,
                                      uint           dataCol,
                                      uint           data3rd,
                                      const KDFrame& frame,
                                      int            outerGapX,
                                      int            outerGapY,
                                      int            innerGapX,
                                      int            innerGapY,
                                      bool           addFrameWidthToLayout  = true,
                                      bool           addFrameHeightToLayout = true );

                uint dataRow() const
                {
                    return _dataRow;
                }
                uint dataCol() const
                {
                    return _dataCol;
                }
                uint data3rd() const
                {
                    return _data3rd;
                }


                const KDFrame* framePtr() const
                {
                    return &_frame;
                }


00203                 const KDFrame& frame() const
                {
                    return _frame;
                }


00209                 int innerGapX() const
                {
                    return _innerGapX;
                }


00215                 int innerGapY() const
                {
                    return _innerGapY;
                }


00221                 int outerGapX() const
                {
                    return _outerGapX;
                }


00227                 int outerGapY() const
                {
                    return _outerGapY;
                }


00233                 bool addFrameWidthToLayout() const
                {
                    return _addFrameWidthToLayout;
                }


00239                 bool addFrameHeightToLayout() const
                {
                    return _addFrameHeightToLayout;
                }


                virtual ~KDChartFrameSettings();


                static void createFrameSettingsNode( QDomDocument& document,
                        QDomNode& parent,
                        const QString& elementName,
                        const KDChartFrameSettings* settings,
                        uint areaId );

                static bool readFrameSettingsNode( const QDomElement& element,
                        KDChartFrameSettings& settings,
                        uint& areaId );

            private:
                uint    _dataRow;
                uint    _dataCol;
                uint    _data3rd;
                KDFrame _frame;
                int     _outerGapX;
                int     _outerGapY;
                int     _innerGapX;
                int     _innerGapY;
                bool    _addFrameWidthToLayout;
                bool    _addFrameHeightToLayout;
        };


00272         void setFrame( uint           area,
                       const KDFrame& frame,
                       int            outerGapX,
                       int            outerGapY,
                       int            innerGapX,
                       int            innerGapY,
                       bool           addFrameWidthToLayout = true,
                       bool           addFrameHeightToLayout = true )
        {
            _areaMap.insert( QString( "%1/-----/-----/-----" ).arg( area, 5 ),
                             KDChartFrameSettings( 0,0,0,
                                                   frame,
                                                   outerGapX,
                                                   outerGapY,
                                                   innerGapX,
                                                   innerGapY,
                                                   addFrameWidthToLayout,
                                                   addFrameHeightToLayout ) );
            emit changed();
        }



00295         void setSimpleFrame( uint        area,
                             int         outerGapX = 0,
                             int         outerGapY = 0,
                             int         innerGapX = 0,
                             int         innerGapY = 0,
                             bool        addFrameWidthToLayout      = true,
                             bool        addFrameHeightToLayout     = true,
                             KDFrame::SimpleFrame    simpleFrame    = KDFrame::FrameFlat,
                             int                     lineWidth      = 1,
                             int                     midLineWidth   = 0,
                             QPen                    pen            = QPen(),
                             QBrush                  background     = QBrush( Qt::NoBrush ),
                             const QPixmap*          backPixmap     = 0, // no pixmap
                             KDFrame::BackPixmapMode backPixmapMode = KDFrame::PixStretched,
                             int                     shadowWidth    = 0,
                             KDFrame::CornerName     sunPos         = KDFrame::CornerTopLeft )
        {
            _areaMap.insert(
                QString( "%1/-----/-----/-----" ).arg( area, 5 ),
                KDChartFrameSettings(
                    0,0,0,
                    KDFrame( QRect(0,0,0,0),
                             simpleFrame,
                             lineWidth,
                             midLineWidth,
                             pen,
                             background,
                             backPixmap,
                             backPixmapMode,
                             shadowWidth,
                             sunPos ),
                    outerGapX,
                    outerGapY,
                    innerGapX,
                    innerGapY,
                    addFrameWidthToLayout,
                    addFrameHeightToLayout ) );
            emit changed();
        }


        void setDataRegionFrame( uint dataRow,
                                 uint dataCol,
                                 uint, // important: we ignore the data3rd parameter for now!
                                 int  innerGapX = 0,
                                 int  innerGapY = 0,
                                 bool addFrameWidthToLayout      = true,
                                 bool addFrameHeightToLayout     = true,
                                 KDFrame::SimpleFrame    simpleFrame    = KDFrame::FrameFlat,
                                 int                     lineWidth      = 1,
                                 int                     midLineWidth   = 0,
                                 QPen                    pen            = QPen(),
                                 int                     shadowWidth    = 0,
                                 KDFrame::CornerName     sunPos         = KDFrame::CornerTopLeft )
        {
            _areaMap.insert(
                QString( "%1/%2/%3/%4" )
                                .arg( KDChartEnums::AreaChartDataRegion, 5 )
                                .arg( dataRow, 5 )
                                .arg( dataCol, 5 )
                                .arg( 0, 5 ),//data3rd, 5 ),
                KDChartFrameSettings(
                    dataRow,
                    dataCol,
                    0, // important: we ignore the data3rd parameter for now!
                    KDFrame( QRect(0,0,0,0),
                             simpleFrame,
                             lineWidth,
                             midLineWidth,
                             pen,
                             QBrush( Qt::NoBrush ),
                             0,
                             KDFrame::PixStretched,
                             shadowWidth,
                             sunPos ),
                    0,
                    0,
                    innerGapX,
                    innerGapY,
                    addFrameWidthToLayout,
                    addFrameHeightToLayout ) );
            emit changed();
        }


        const KDChartFrameSettings* frameSettings( uint area,
                                                   bool& bFound,
                                                   int* pIterIdx=0 ) const;

        const KDChartFrameSettings* nextFrameSettings( bool& bFound,
                                                       int* pIterIdx ) const;


00388         typedef QMap < uint, KDChartCustomBox > CustomBoxMap;

        uint insertCustomBox( const KDChartCustomBox & box );
        bool removeCustomBox( const uint & idx );

00393         void removeAllCustomBoxes()
        {
            emit changed();
            _customBoxMap.clear();
        }

        KDChartCustomBox* customBoxRef( uint box );
        const KDChartCustomBox* customBox( uint box ) const;
        uint maxCustomBoxIdx() const;


00404         enum ChartType { NoType, Bar, Line, Area, Pie, HiLo, Ring, Polar, BoxWhisker };

        void setChartType( ChartType chartType );
00407         ChartType chartType() const
        {
            return _chartType;
        }


        static QString chartTypeToString( ChartType type );
        static ChartType stringToChartType( const QString& string );

        void setAdditionalChartType( ChartType chartType );
00417         ChartType additionalChartType() const
        {
            return _additionalChartType;
        }


00423         enum SourceMode {
                UnknownMode      = 0,
                DontUse          = 1,
                DataEntry        = 2,
                AxisLabel        = 3,
                LegendText       = 4,
                ExtraLinesAnchor = 5,
                Last_SourceMode  = ExtraLinesAnchor };

        void setChartSourceMode( SourceMode mode,
                uint dataset,
                uint dataset2 = KDCHART_NO_DATASET,
                uint chart = 0 );

        static QString chartSourceModeToString( const SourceMode& mode );
        static SourceMode stringToChartSourceMode( const QString& string );


00441         bool neverUsedSetChartSourceMode() const
        {
            return !_setChartSourceModeWasUsed;
        }

        SourceMode chartSourceMode( uint dataset,
                uint dataset2 = KDCHART_NO_DATASET,
                uint* chart = 0 ) const;

        bool findDataset( SourceMode mode,
                          uint& dataset,
                          uint& dataset2,
                          uint chart = 0 ) const;

        bool findDatasets( SourceMode mode1,
                           SourceMode mode2,
                           uint& dataset,
                           uint& dataset2,
                           uint chart = 0 ) const;

00461         uint maxDatasetSourceMode() const
        {
            return _maxDatasetSourceMode;
        }


        void setDefaultAxesTypes();
        void activateDefaultAxes();


00471         void setNumValues( uint numValues )
        {
            _numValues = numValues;
            emit changed();
        }


00478         int numValues() const
        {
            return _numValues;
        }


        void calculateShadowColors( QColor color,
                                    QColor& shadow1,
                                    QColor& shadow2 ) const;

        void setDataColor( uint dataset, QColor color );
        QColor dataColor( uint dataset ) const;

        void setDataDefaultColors();
        void setDataRainbowColors();
        void setDataSubduedColors( bool ordered = false );


00496         void setShadowBrightnessFactor( double factor )
        {
            _shadowBrightnessFactor = factor;
            recomputeShadowColors();
            emit changed();
        }

00503         double shadowBrightnessFactor() const
        {
            return _shadowBrightnessFactor;
        }


00509         void setShadowPattern( Qt::BrushStyle style ) {
            _shadowPattern = style;
            emit changed();
        }

00514         Qt::BrushStyle shadowPattern() const {
            return _shadowPattern;
        }


00519         void setOutlineDataColor( QColor color )
        {
            _outlineDataColor = color;
            emit changed();
        }


00526         QColor outlineDataColor() const
        {
            return _outlineDataColor;
        }


00532         void setOutlineDataLineWidth( uint width )
        {
            _outlineDataLineWidth = width;
            emit changed();
        }

00538         uint outlineDataLineWidth() const
        {
            return _outlineDataLineWidth;
        }


00544         void setOutlineDataLineStyle( PenStyle style )
        {
            _outlineDataLineStyle = style;
            emit changed();
        }

00550         PenStyle outlineDataLineStyle() const
        {
            return _outlineDataLineStyle;
        }


00556         uint maxDataColor() const
        {
            return _maxDatasetColor;
        }


00562         void setThreeDShadowColors( bool shadow )
        {
            _threeDShadowColors = shadow;
            emit changed();
        }


00569         bool threeDShadowColors() const
        {
            return _threeDShadowColors;
        }


00575         static int roundVal( double d )
        {
            double fr;
            double i=0.0; // initialization necessary for Borland C++
            fr = modf( d, &i );
            int ret = static_cast < int > ( i );
            if( 0.49999 <= fabs( fr ) )
                ret += ( 0.0 < d ) ? 1 : -1;
            return ret;
        }


        void setPrintDataValues( bool active,
                                 uint chart = KDCHART_ALL_CHARTS,
                                 int divPow10 = 0,
                                 int digitsBehindComma = DATA_VALUE_AUTO_DIGITS,
                                 QFont* font   = 0,
                                 uint size     = UINT_MAX, //  <-- makes us use the *default* font params
                                 //                                by IGNORING settings of
                                 //                                the following parameters!
                                 QColor* color = DATA_VALUE_AUTO_COLOR,
                                 KDChartEnums::PositionFlag negativePosition = KDChartEnums::PosCenter,
                                 uint negativeAlign    = Qt::AlignCenter,
                                 int  negativeDeltaX   =    0,
                                 int  negativeDeltaY   =    0,
                                 int  negativeRotation =    0,
                                 KDChartEnums::PositionFlag positivePosition = KDChartEnums::PosCenter,
                                 uint positiveAlign    = Qt::AlignCenter,
                                 int  positiveDeltaX   =    0,
                                 int  positiveDeltaY   =    0,
                                 int  positiveRotation =    0,
                                 KDChartEnums::TextLayoutPolicy policy = KDChartEnums::LayoutPolicyRotate );

        void setDataValuesCalc( int divPow10 = 0,
                                int digitsBehindComma = DATA_VALUE_AUTO_DIGITS,
                                uint chart = KDCHART_ALL_CHARTS );
        void setDataValuesFont( QFont* font,
                                uint size  = UINT_MAX,
                                uint chart = KDCHART_ALL_CHARTS );
        void setDataValuesPlacing( KDChartEnums::PositionFlag position,
                                   uint align,
                                   int  deltaX,
                                   int  deltaY,
                                   int  rotation,
                                   bool specifyingPositiveValues = true,
                                   uint chart = KDCHART_ALL_CHARTS );
        void setDataValuesColors( const QColor* color = DATA_VALUE_AUTO_COLOR,
                                  const QBrush& background = Qt::NoBrush,
                                  uint chart = KDCHART_ALL_CHARTS );
        void setDataValuesPolicy( KDChartEnums::TextLayoutPolicy policy = KDChartEnums::LayoutPolicyRotate,
                                  uint chart = KDCHART_ALL_CHARTS );

        void setDataValuesShowInfinite( bool dataValuesShowInfinite = true,
                                        uint chart = KDCHART_ALL_CHARTS );

        void setPrintDataValuesWithDefaultFontParams( uint chart = KDCHART_ALL_CHARTS,
                                                      bool callSetPrintDataValues = true );

00633         void setAllowOverlappingDataValueTexts( bool allow )
        {
            _allowOverlappingDataValueTexts = allow;
        }


00639         bool allowOverlappingDataValueTexts() const
        {
            return _allowOverlappingDataValueTexts;
        }

00644         bool printDataValuesWithDefaultFontParams( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._useDefaultFontParams
                : _printDataValuesSettings._useDefaultFontParams;
        }

00650         bool printDataValues( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._printDataValues
                : _printDataValuesSettings._printDataValues;
        }


        int dataValuesDivPow10( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._divPow10
                : _printDataValuesSettings._divPow10;
        }


        int dataValuesDigitsBehindComma( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._digitsBehindComma
                : _printDataValuesSettings._digitsBehindComma;
        }


00671         QFont dataValuesFont( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesFont
                : _printDataValuesSettings._dataValuesFont;
        }


00678         bool dataValuesUseFontRelSize( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesUseFontRelSize
                : _printDataValuesSettings._dataValuesUseFontRelSize;
        }


00685         int dataValuesFontRelSize( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesFontRelSize
                : _printDataValuesSettings._dataValuesFontRelSize;
        }


00692         QColor dataValuesColor( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesColor
                : _printDataValuesSettings._dataValuesColor;
        }


        QBrush dataValuesBackground( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesBrush
                         : _printDataValuesSettings._dataValuesBrush;
        }


00706         bool dataValuesAutoColor( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesAutoColor
                : _printDataValuesSettings._dataValuesAutoColor;
        }


        KDChartEnums::PositionFlag dataValuesAnchorPosition( uint chart,
                bool negative ) const;
        uint dataValuesAnchorAlign( uint chart, bool negative ) const;
        int dataValuesAnchorDeltaX( uint chart, bool negative ) const;
        int dataValuesAnchorDeltaY( uint chart, bool negative ) const;
        int dataValuesRotation( uint chart, bool negative ) const;


00721         KDChartEnums::TextLayoutPolicy dataValuesLayoutPolicy( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesLayoutPolicy
                : _printDataValuesSettings._dataValuesLayoutPolicy;
        }


        bool dataValuesShowInfinite( uint chart ) const
        {
            return chart ? _printDataValuesSettings2._dataValuesShowInfinite
                : _printDataValuesSettings._dataValuesShowInfinite;
        }


        // for backward compatibility we may NOT remove these functions:
        void setPrintDataValuesColor( uint chart = KDCHART_ALL_CHARTS,
                                      const QColor* color = DATA_VALUE_AUTO_COLOR );
        void setPrintDataValuesFontRelSize( uint chart, uint size );



        // END GENERAL




        // BAR CHART-SPECIFIC
00748         enum BarChartSubType { BarNormal, BarStacked, BarPercent, BarMultiRows };

00750         void setBarChartSubType( BarChartSubType barChartSubType )
        {
            _barChartSubType = barChartSubType;
            emit changed();
        }

00756         BarChartSubType barChartSubType() const
        {
            return _barChartSubType;
        }

        static QString barChartSubTypeToString( BarChartSubType type );
        static BarChartSubType stringToBarChartSubType( const QString& string );

00764         void setThreeDBars( bool threeDBars )
        {
            _threeDBars = threeDBars;
            emit changed();
        }

00770         bool threeDBars() const
        {
            return _threeDBars;
        }


00776         void setThreeDBarsShadowColors( bool shadow )
        {
            _threeDShadowColors = shadow;
            emit changed();
        }


00783         bool threeDBarsShadowColors() const
        {
            return _threeDShadowColors;
        }


        QColor dataShadow1Color( uint dataset ) const;
        QColor dataShadow2Color( uint dataset ) const;


        void setThreeDBarAngle( uint angle );
00794         uint threeDBarAngle() const
        {
            return _threeDBarAngle;
        }


00800         double cosThreeDBarAngle() const
        {
            return _cosThreeDBarAngle;
        }


00806         void setThreeDBarDepth( double depth )
        {
            _threeDBarDepth = depth;
            emit changed();
        }


00813         double threeDBarDepth() const
        {
            return _threeDBarDepth;
        }


00819         void setDatasetGap( int gap )
        {
            _datasetGap = gap;
            emit changed();
        }

00825         int datasetGap() const
        {
            return _datasetGap;
        }


00831         void setDatasetGapIsRelative( bool gapIsRelative )
        {
            _datasetGapIsRelative = gapIsRelative;
            emit changed();
        }

00837         bool datasetGapIsRelative() const
        {
            return _datasetGapIsRelative;
        }


00843         void setValueBlockGap( int gap )
        {
            _valueBlockGap = gap;
            emit changed();
        }

00849         int valueBlockGap() const
        {
            return _valueBlockGap;
        }


00855         void setValueBlockGapIsRelative( bool gapIsRelative )
        {
            _valueBlockGapIsRelative = gapIsRelative;
            emit changed();
        }

00861         bool valueBlockGapIsRelative() const
        {
            return _valueBlockGapIsRelative;
        }

00866         void setDrawSolidExcessArrows( bool solidArrows ) {
            _solidExcessArrows = solidArrows;
            emit changed();
        }

00871         bool drawSolidExcessArrows() const
        {
            return _solidExcessArrows;
        }

        // END BAR CHART-SPECIFIC


        // LINE/AREA CHART-SPECIFIC
00880         enum LineChartSubType { LineNormal, LineStacked, LinePercent };

00882         void setLineChartSubType( LineChartSubType lineChartSubType )
        {
            _lineChartSubType = lineChartSubType;
            emit changed();
        }

00888         LineChartSubType lineChartSubType() const
        {
            return _lineChartSubType;
        }


        static LineChartSubType stringToLineChartSubType( const QString& string );
        static QString lineChartSubTypeToString( LineChartSubType type );


00898         void setLineMarker( bool marker )
        {
            _lineMarker = marker;
            emit changed();
        }

00904         bool lineMarker() const
        {
            return _lineMarker;
        }

00909         enum LineMarkerStyle { LineMarkerCircle  = 0,
            LineMarkerSquare  = 1,
            LineMarkerDiamond = 2,
            LineMarker1Pixel  = 3,
            LineMarker4Pixels = 4,
            LineMarkerRing    = 5,
            LineMarkerCross   = 6 };

        void setLineMarkerStyle( uint dataset, LineMarkerStyle style );
        LineMarkerStyle lineMarkerStyle( uint dataset ) const;


        static QString lineMarkerStyleToString( LineMarkerStyle style );
        static QString lineMarkerStyleToStringTr( LineMarkerStyle style );
        static LineMarkerStyle stringToLineMarkerStyle( const QString& string );
        static LineMarkerStyle stringToLineMarkerStyleTr( const QString& string );

00926         typedef QMap<uint,LineMarkerStyle> LineMarkerStyleMap;

        void setLineMarkerStyles( LineMarkerStyleMap map );

00930         LineMarkerStyleMap lineMarkerStyles() const {
            return _lineMarkerStyles;
        }


00935         uint maxDatasetLineMarkerStyle() const
        {
            return _maxDatasetLineMarkerStyle;
        }


00941         void setLineMarkerSize( QSize size )
        {
            _lineMarkerSize = size;
            emit changed();
        }

00947         QSize lineMarkerSize() const
        {
            return _lineMarkerSize;
        }

00952         void setLineWidth( int width )
        {
            _lineWidth = width;
            emit changed();
        }

00958         int lineWidth() const
        {
            return _lineWidth;
        }


00964         void setLineColor( QColor color = QColor() )
        {
            _lineColor = color;
            emit changed();
        }

00970         QColor lineColor() const
        {
            return _lineColor;
        }

00975         void setLineStyle( PenStyle style )
        {
            _lineStyle = style;
            emit changed();
        }

00981         PenStyle lineStyle() const
        {
            return _lineStyle;
        }


00987         void setThreeDLines( bool threeD ) {
            _threeDLines = threeD;
            emit changed();
        }


00993         bool threeDLines() const {
            return _threeDLines;
        }


00998         void setThreeDLineDepth( int depth ) {
            _threeDLineDepth = depth;
            emit changed();
        }


01004         int threeDLineDepth() const {
            return _threeDLineDepth;
        }


        // NOTE: documentation of this function is temporary disabled.
        // Feature is currently not supported, will be implemented
        // by future versions of KDChart
01012         void setThreeDLineXRotation( int degrees ) {
            _threeDLineXRotation = degrees;
            emit changed();
        }


        // NOTE: documentation of this function is temporary disabled.
        // Feature is currently not supported, will be implemented
        // by future versions of KDChart
01021         int threeDLineXRotation() const {
            return _threeDLineXRotation;
        }


        // NOTE: documentation of this function is temporary disabled.
        // Feature is currently not supported, will be implemented
        // by future versions of KDChart
01029         void setThreeDLineYRotation( int degrees ) {
            _threeDLineYRotation = degrees;
            emit changed();
        }


        // NOTE: documentation of this function is temporary disabled.
        // Feature is currently not supported, will be implemented
        // by future versions of KDChart
01038         int threeDLineYRotation() const {
            return _threeDLineYRotation;
        }


01043         enum AreaChartSubType { AreaNormal, AreaStacked, AreaPercent };


01046         void setAreaChartSubType( AreaChartSubType areaChartSubType )
        {
            _areaChartSubType = areaChartSubType;
            // activate default data value text settings for this chart type
            if(    printDataValues( 0 )
                && printDataValuesWithDefaultFontParams( 0 ) )
                setPrintDataValues( true, 0 );
            emit changed();
        }


01057         AreaChartSubType areaChartSubType() const
        {
            return _areaChartSubType;
        }


        static QString areaChartSubTypeToString( AreaChartSubType type );
        static AreaChartSubType stringToAreaChartSubType( const QString& string );


01067         enum AreaLocation { AreaAbove, AreaBelow };

01069         void setAreaLocation( AreaLocation location )
        {
            _areaLocation = location;
            emit changed();
        }

01075         AreaLocation areaLocation() const
        {
            return _areaLocation;
        }


        static QString areaLocationToString( AreaLocation type );
        static AreaLocation stringToAreaLocation( const QString& string );

        // END LINE/AREA CHART-SPECIFIC

        // POLAR CHART-SPECIFIC
01087         enum PolarChartSubType { PolarNormal, PolarStacked, PolarPercent };

01089         void setPolarChartSubType( PolarChartSubType polarChartSubType )
        {
            _polarChartSubType = polarChartSubType;
            emit changed();
        }

01095         PolarChartSubType polarChartSubType() const
        {
            return _polarChartSubType;
        }


        static PolarChartSubType stringToPolarChartSubType( const QString& string );
        static QString polarChartSubTypeToString( PolarChartSubType type );

01104         void setPolarMarker( bool marker )
        {
            _polarMarker = marker;
            emit changed();
        }

01110         bool polarMarker() const
        {
            return _polarMarker;
        }

01115         enum PolarMarkerStyle { PolarMarkerCircle, PolarMarkerSquare,
                                PolarMarkerDiamond };

        void setPolarMarkerStyle( uint dataset, PolarMarkerStyle style );
        PolarMarkerStyle polarMarkerStyle( uint dataset ) const;
        static QString polarMarkerStyleToString( PolarMarkerStyle style );
        static QString polarMarkerStyleToStringTr( PolarMarkerStyle style );
        static PolarMarkerStyle stringToPolarMarkerStyle( const QString& string );
        static PolarMarkerStyle stringToPolarMarkerStyleTr( const QString& string );

01125         typedef QMap<uint,PolarMarkerStyle> PolarMarkerStyleMap;

        void setPolarMarkerStyles( PolarMarkerStyleMap map );

01129         PolarMarkerStyleMap polarMarkerStyles() const {
            return _polarMarkerStyles;
        }

01133         uint maxDatasetPolarMarkerStyle() const
        {
            return _maxDatasetPolarMarkerStyle;
        }

01138         void setPolarMarkerSize( QSize size = QSize( -40, -40 ) )
        {
            _polarMarkerSize = size;
            emit changed();
        }

01144         QSize polarMarkerSize() const
        {
            return _polarMarkerSize;
        }

01149         void setPolarLineWidth( int width = -3 )
        {
            _polarLineWidth = width;
            emit changed();
        }

01155         int polarLineWidth() const
        {
            return _polarLineWidth;
        }


01161         void setPolarZeroDegreePos( int degrees )
        {
            _polarZeroDegreePos = degrees;
        }

01166         int polarZeroDegreePos() const
        {
            return _polarZeroDegreePos;
        }


01172         void setPolarRotateCircularLabels( bool rotateCircularLabels )
        {
            _polarRotateCircularLabels = rotateCircularLabels;
        }

01177         bool polarRotateCircularLabels() const
        {
            return _polarRotateCircularLabels;
        }

        void setPolarDelimsAndLabelsAtPos( KDChartEnums::PositionFlag pos,
                bool showDelimiters,
                bool showLabels );
        bool polarDelimAtPos( KDChartEnums::PositionFlag pos ) const;
        bool polarLabelsAtPos( KDChartEnums::PositionFlag pos ) const;

        // END POLAR CHART-SPECIFIC


        // PIE/RING CHART-SPECIFIC

01193         void setExplode( bool explode )
        {
            _explode = explode;
            emit changed();
        }

01199         bool explode() const
        {
            return _explode;
        }


01205         void setExplodeValues( QValueList<int> explodeList ) {
            _explodeList = explodeList;
            emit changed();
        }


01211         QValueList<int> explodeValues() const {
            return _explodeList;
        }

        typedef QMap<int,double> ExplodeFactorsMap;

        void setExplodeFactors( ExplodeFactorsMap factors ) {
            _explodeFactors = factors;
            emit changed();
        }


01223         ExplodeFactorsMap explodeFactors() const {
            return _explodeFactors;
        }


01228         void setExplodeFactor( double factor )
        {
            _explodeFactor = factor;
            emit changed();
        }

01234         double explodeFactor() const
        {
            return _explodeFactor;
        }


01240         void setThreeDPies( bool threeDPies )
        {
            _threeDPies = threeDPies;
            emit changed();
        }

01246         bool threeDPies() const
        {
            return _threeDPies;
        }


01252         void setThreeDPieHeight( int pixels )
        {
            _threeDPieHeight = pixels;
            emit changed();
        }

01258         int threeDPieHeight() const
        {
            return _threeDPieHeight;
        }

01263         void setPieStart( int degrees )
        {
            while ( degrees < 0 )
                degrees += 360;
            while ( degrees >= 360 )
                degrees -= 360;
            _pieStart = degrees;

            emit changed();
        }


01275         int pieStart() const
        {
            return _pieStart;
        }

01280         void setRingStart( int degrees )
        {
            while ( degrees < 0 )
                degrees += 360;
            while ( degrees >= 360 )
                degrees -= 360;
            _ringStart = degrees;

            emit changed();
        }


01292         int ringStart() const
        {
            return _ringStart;
        }

01297         void setRelativeRingThickness( bool relativeThickness ) {
            _relativeRingThickness = relativeThickness;

            emit changed();
        }


01304         bool relativeRingThickness() const {
            return _relativeRingThickness;
        }

        // END PIE/RING CHART-SPECIFIC


        // HI/LO CHART-SPECIFIC
01312         enum HiLoChartSubType { HiLoNormal, HiLoSimple = HiLoNormal,
                                HiLoClose, HiLoOpenClose };

01315         void setHiLoChartSubType( HiLoChartSubType hiLoChartSubType )
        {
            _hiLoChartSubType = hiLoChartSubType;
            emit changed();
        }

01321         HiLoChartSubType hiLoChartSubType() const
        {
            return _hiLoChartSubType;
        }

        static QString hiLoChartSubTypeToString( HiLoChartSubType type );
        static HiLoChartSubType stringToHiLoChartSubType( const QString& string );
        void setHiLoChartPrintLowValues( bool active,
                QFont* font = 0,
                int size = 14,
                QColor* color = 0 );

01333         bool hiLoChartPrintLowValues() const
        {
            return _hiLoChartPrintLowValues;
        }


01339         QFont hiLoChartLowValuesFont() const
        {
            return _hiLoChartLowValuesFont;
        }


01345         bool hiLoChartLowValuesUseFontRelSize() const
        {
            return _hiLoChartLowValuesUseFontRelSize;
        }


01351         int hiLoChartLowValuesFontRelSize() const
        {
            return _hiLoChartLowValuesFontRelSize;
        }


01357         QColor hiLoChartLowValuesColor() const
        {
            return _hiLoChartLowValuesColor;
        }

        void setHiLoChartPrintHighValues( bool active,
                QFont* font = 0,
                int size = 14,
                QColor* color = 0 );


01368         bool hiLoChartPrintHighValues() const
        {
            return _hiLoChartPrintHighValues;
        }


01374         QFont hiLoChartHighValuesFont() const
        {
            return _hiLoChartHighValuesFont;
        }


01380         bool hiLoChartHighValuesUseFontRelSize() const
        {
            return _hiLoChartHighValuesUseFontRelSize;
        }


01386         int hiLoChartHighValuesFontRelSize() const
        {
            return _hiLoChartHighValuesFontRelSize;
        }


01392         QColor hiLoChartHighValuesColor() const
        {
            return _hiLoChartHighValuesColor;
        }

        void setHiLoChartPrintOpenValues( bool active,
                QFont* font = 0,
                uint size = 14,
                QColor* color = 0 );

01402         bool hiLoChartPrintOpenValues() const
        {
            return _hiLoChartPrintOpenValues;
        }


01408         QFont hiLoChartOpenValuesFont() const
        {
            return _hiLoChartOpenValuesFont;
        }


01414         bool hiLoChartOpenValuesUseFontRelSize() const
        {
            return _hiLoChartOpenValuesUseFontRelSize;
        }


01420         int hiLoChartOpenValuesFontRelSize() const
        {
            return _hiLoChartOpenValuesFontRelSize;
        }


01426         QColor hiLoChartOpenValuesColor() const
        {
            return _hiLoChartOpenValuesColor;
        }

        void setHiLoChartPrintCloseValues( bool active,
                QFont* font = 0,
                int size = 14,
                QColor* color = 0 );

01436         bool hiLoChartPrintCloseValues() const
        {
            return _hiLoChartPrintCloseValues;
        }


01442         QFont hiLoChartCloseValuesFont() const
        {
            return _hiLoChartCloseValuesFont;
        }


01448         bool hiLoChartCloseValuesUseFontRelSize() const
        {
            return _hiLoChartCloseValuesUseFontRelSize;
        }


01454         int hiLoChartCloseValuesFontRelSize() const
        {
            return _hiLoChartCloseValuesFontRelSize;
        }


01460         QColor hiLoChartCloseValuesColor() const
        {
            return _hiLoChartCloseValuesColor;
        }


01466         void setHiLoChartPrintFirstValues( bool active,
                QFont* font = 0,
                uint size = 14,
                QColor* color = 0 )
        {
            setHiLoChartPrintOpenValues( active, font, size, color );
        }

01474         bool hiLoChartPrintFirstValues() const
        {
            return hiLoChartPrintOpenValues();
        }


01480         QFont hiLoChartFirstValuesFont() const
        {
            return hiLoChartOpenValuesFont();
        }


01486         bool hiLoChartFirstValuesUseFontRelSize() const
        {
            return hiLoChartOpenValuesUseFontRelSize();
        }

01491         int hiLoChartFirstValuesFontRelSize() const
        {
            return hiLoChartOpenValuesFontRelSize();
        }

01496         QColor hiLoChartFirstValuesColor() const
        {
            return hiLoChartOpenValuesColor();
        }

01501         void setHiLoChartPrintLastValues( bool active,
                QFont* font = 0,
                int size = 14,
                QColor* color = 0 )
        {
            setHiLoChartPrintCloseValues( active, font, size, color );
        }

01509         bool hiLoChartPrintLastValues() const
        {
            return hiLoChartPrintCloseValues();
        }

01514         QFont hiLoChartLastValuesFont() const
        {
            return hiLoChartCloseValuesFont();
        }

01519         bool hiLoChartLastValuesUseFontRelSize() const
        {
            return hiLoChartCloseValuesUseFontRelSize();
        }

01524         int hiLoChartLastValuesFontRelSize() const
        {
            return hiLoChartCloseValuesFontRelSize();
        }

01529         QColor hiLoChartLastValuesColor() const
        {
            return hiLoChartCloseValuesColor();
        }


        // END HI/LO CHART-SPECIFIC



        // BOX WHISKER CHART-SPECIFIC
01540         enum BWChartSubType { BWNormal, BWSimple = BWNormal };

01542         enum BWStatVal {                  BWStatValSTART,
                        UpperOuterFence = BWStatValSTART,  // first value stored in array
                        UpperInnerFence,
                        Quartile3,
                        Median,
                        Quartile1,
                        LowerInnerFence,
                        LowerOuterFence,
                        MaxValue,
                        MeanValue,
                        MinValue,
                        BWStatValEND = MinValue,          // last value stored in array
                        //  extra values - not stored in the array:
                        BWStatValOffEndValue,  // the number of array values
                        BWStatValALL,          // special flag reprsenting *all* array values
                        BWStatValUNKNOWN };    // to be returned when value is undefined

01559         void setBWChartSubType( BWChartSubType bWChartSubType )
        {
            _BWChartSubType = bWChartSubType;
            emit changed();
        }

01565         BWChartSubType bWChartSubType() const
        {
            return _BWChartSubType;
        }

        static QString bWChartSubTypeToString( BWChartSubType type );
        static BWChartSubType stringToBWChartSubType( const QString& string );
        static QString bWChartStatValToString( BWStatVal type );
        static BWStatVal stringToBWChartStatVal( const QString& string );

        void setBWChartFences( double upperInner, double lowerInner,
                double upperOuter, double lowerOuter );
        void bWChartFences( double& upperInner, double& lowerInner,
                double& upperOuter, double& lowerOuter ) const;

01580         void setBWChartBrush( const QBrush& bWChartBrush )
        {
            _BWChartBrush = bWChartBrush;
            emit changed();
        }

01586         QBrush bWChartBrush() const
        {
            return _BWChartBrush;
        }

01591         void setBWChartOutValMarkerSize( int size )
        {
            _BWChartOutValMarkerSize = size;
        }


01597         int bWChartOutValMarkerSize() const
        {
            return _BWChartOutValMarkerSize;
        }

        void setBWChartPrintStatistics( BWStatVal statValue,
                bool active,
                QFont* font = 0,
                int size = 24,
                QColor* color = 0,
                QBrush* brush = 0 );

01609         bool bWChartPrintStatistics( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].active;
        }


01615         QFont bWChartStatisticsFont( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].font;
        }


01621         bool bWChartStatisticsUseRelSize( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].useRelSize;
        }


01627         int bWChartStatisticsFontRelSize( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].relSize;
        }


01633         QColor bWChartStatisticsColor( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].color;
        }

01638         QBrush bWChartStatisticsBrush( BWStatVal statValue ) const
        {
            return _BWChartStatistics[ statValue ].brush;
        }



        // LEGENDS

01647         enum LegendPosition { NoLegend, LegendTop, LegendBottom,
            LegendLeft, LegendRight,
            LegendTopLeft,
            LegendTopLeftTop,
            LegendTopLeftLeft,
            LegendTopRight,
            LegendTopRightTop,
            LegendTopRightRight,
            LegendBottomLeft,
            LegendBottomLeftBottom,
            LegendBottomLeftLeft,
            LegendBottomRight,
            LegendBottomRightBottom,
            LegendBottomRightRight
        };


01664         void setLegendPosition( LegendPosition position )
        {
            _legendPosition = position;
            emit changed();
        }

01670         LegendPosition legendPosition() const
        {
            return _legendPosition;
        }


        static QString legendPositionToString( LegendPosition pos );
        static LegendPosition stringToLegendPosition( const QString& string );

01679         enum LegendSource { LegendManual, LegendFirstColumn, LegendAutomatic };

01681         void setLegendSource( LegendSource source )
        {
            _legendSource = source;
            emit changed();
        }

01687         LegendSource legendSource() const
        {
            return _legendSource;
        }

        static QString legendSourceToString( LegendSource source );
        static LegendSource stringToLegendSource( const QString& string );

01695         void setLegendText( uint dataset, const QString& text )
        {
            _legendText[ dataset ] = text;
            emit changed();
        }

01701         QString legendText( uint dataset ) const
        {
            if( _legendText.find( dataset ) != _legendText.end() )
                return _legendText[ dataset ];
            else
                return QString::null;
        }


01710         void setLegendTextColor( const QColor& color )
        {
            _legendTextColor = color;
            emit changed();
        }


01717         QColor legendTextColor() const
        {
            return _legendTextColor;
        }


01723         void setLegendFont( const QFont& font, bool useFontSize )
        {
            _legendFont = font;
            _legendFontUseRelSize = ! useFontSize;
            emit changed();
        }

01730         QFont legendFont() const
        {
            return _legendFont;
        }


01736         void setLegendFontUseRelSize( bool legendFontUseRelSize )
        {
            _legendFontUseRelSize = legendFontUseRelSize;
            emit changed();
        }

01742         bool legendFontUseRelSize() const
        {
            return _legendFontUseRelSize;
        }

01747         void setLegendFontRelSize( int legendFontRelSize )
        {
            _legendFontRelSize = legendFontRelSize;
            emit changed();
        }

01753         int legendFontRelSize() const
        {
            return _legendFontRelSize;
        }


01759         void setLegendTitleText( const QString& text )
        {
            _legendTitleText = text;
            emit changed();
        }


01766         QString legendTitleText() const
        {
            return _legendTitleText;
        }


01772         void setLegendTitleTextColor( const QColor& color )
        {
            _legendTitleTextColor = color;
            emit changed();
        }


01779         QColor legendTitleTextColor() const
        {
            return _legendTitleTextColor;
        }



01786         void setLegendTitleFont( const QFont& font, bool useFontSize )
        {
            _legendTitleFont = font;
            _legendTitleFontUseRelSize = ! useFontSize;
            emit changed();
        }

01793         QFont legendTitleFont() const
        {
            return _legendTitleFont;
        }


01799         void setLegendTitleFontUseRelSize( bool legendTitleFontUseRelSize )
        {
            _legendTitleFontUseRelSize = legendTitleFontUseRelSize;
            emit changed();
        }

01805         bool legendTitleFontUseRelSize() const
        {
            return _legendTitleFontUseRelSize;
        }

01810         void setLegendTitleFontRelSize( int legendTitleFontRelSize )
        {
            _legendTitleFontRelSize = legendTitleFontRelSize;
            emit changed();
        }

01816         int legendTitleFontRelSize() const
        {
            return _legendTitleFontRelSize;
        }


01822         void setLegendSpacing( uint space )
        {
            _legendSpacing = space;
        }


01828         uint legendSpacing() const
        {
            return _legendSpacing;
        }

        // END LEGENDS



        // AXES

01839         void setAxisType( uint n, const KDChartAxisParams::AxisType axisType )
        {
            if ( n < KDCHART_MAX_AXES ) {
                _axisSettings[ n ].params.setAxisType( axisType );
                emit changed();
            }
        }

01847         void setAxisVisible( uint n,
                const bool axisVisible )
        {
            if ( n < KDCHART_MAX_AXES ) {
                _axisSettings[ n ].params.setAxisVisible( axisVisible );
                emit changed();
            }
        }

01856         bool axisVisible( uint n ) const
        {
            return n < KDCHART_MAX_AXES ? _axisSettings[ n ].params.axisVisible()
                : false;
        }

        void setAxisShowGrid( uint n,
                bool axisShowGrid );
        bool showGrid() const;
        void setAxisDatasets( uint n,
                uint dataset,
                uint dataset2 = KDCHART_NO_DATASET,
                uint chart = 0 );
        bool axisDatasets( uint n,
                uint& dataset,
                uint& dataset2,
                uint& chart ) const;

#if COMPAT_QT_VERSION >= 0x030000
        typedef QValueVector<uint> AxesArray;
#else
        typedef QArray<uint> AxesArray;
#endif

        bool chartAxes( uint chart, uint& cnt, AxesArray& axes ) const;

01882         void setAxisArea( const uint n, const QRect& areaRect )
        {
            if ( n < KDCHART_MAX_AXES ) {
                _axisSettings[ n ].params.setAxisTrueAreaRect( areaRect );
                // Do not do emit changed() here!
            }
        }

01890         void setAxisLabelsTouchEdges( uint n, bool axisLabelsTouchEdges )
        {
            _axisSettings[ n ].params.setAxisLabelsTouchEdges(
                    axisLabelsTouchEdges );
            emit changed();
        }

01897         void setAxisLabelsVisible( uint n,
                bool axisLabelsVisible )
        {
            if ( n < KDCHART_MAX_AXES )
                _axisSettings[ n ].params.setAxisLabelsVisible( axisLabelsVisible );
        }

        void setAxisLabelsFont( uint n,
                                QFont axisLabelsFont,
                                int axisLabelsFontSize = 0,
                                QColor axisLabelsColor = Qt::black );

01909         void setAxisLabelTextParams( uint n,
            bool axisSteadyValueCalc   = true,
            KDChartData axisValueStart = KDChartAxisParams::AXIS_LABELS_AUTO_LIMIT,
            KDChartData axisValueEnd   = KDChartAxisParams::AXIS_LABELS_AUTO_LIMIT,
            double axisValueDelta      = KDChartAxisParams::AXIS_LABELS_AUTO_DELTA,
            int axisDigitsBehindComma  = KDChartAxisParams::AXIS_LABELS_AUTO_DIGITS,
            int axisMaxEmptyInnerSpan  = 67,
            KDChartAxisParams::LabelsFromDataRow takeLabelsFromDataRow
                                       = KDChartAxisParams::LabelsFromDataRowNo,
            int labelTextsDataRow      = 0,
            QStringList* axisLabelStringList = 0,
            QStringList* axisShortLabelsStringList = 0 )
        {
            _axisSettings[ n ].params.setAxisValues(
                    axisSteadyValueCalc,
                    axisValueStart,
                    axisValueEnd,
                    axisValueDelta,
                    axisDigitsBehindComma,
                    axisMaxEmptyInnerSpan,
                    takeLabelsFromDataRow,
                    labelTextsDataRow,
                    axisLabelStringList,
                    axisShortLabelsStringList );
            emit changed();
        }


        void setAxisLabelStringParams( uint n,
                QStringList*   axisLabelStringList,
                QStringList*   axisShortLabelStringList,
                const QString& valueStart = QString::null,
                const QString& valueEnd   = QString::null );


        void setAxisParams( uint n,
                const KDChartAxisParams& axisParams );

01947         const KDChartAxisParams& axisParams( uint n ) const
        {
            return n < KDCHART_MAX_AXES ? _axisSettings[ n ].params
                : _axisSettings[ KDCHART_MAX_AXES ].params;
        }

        // some convenience functions refering to the first KDChartCustomBox
        // that is anchored to the axis n.
        bool findFirstAxisCustomBoxID(   uint n, uint& boxID ) const;
        void setAxisTitle(               uint n, const QString& axisTitle );
        QString axisTitle(               uint n ) const;
        void setAxisTitleColor(          uint n, QColor axisTitleColor );
        QColor axisTitleColor(           uint n ) const;
        void setAxisTitleFont(           uint n, QFont axisTitleFont );
        QFont axisTitleFont(             uint n ) const;
        void setAxisTitleFontUseRelSize( uint n, bool useRelSize );
        bool axisTitleFontUseRelSize(    uint n ) const;
        void setAxisTitleFontRelSize(    uint n, int axisTitleFontRelSize );
        int axisTitleFontRelSize(        uint n ) const;

        // END AXES


        // HEADERS/FOOTERS


        /*
        READ before changing/enhancing the following enum
        =================================================

        Please note: The following enum is made in a way that
        sections with smaller Y values come first.
        Thus one can construct a loop itterating over theHdFtPos values
        and so going from the top of the screen toiwards the bottom...

        Also please note that extending this enum shound NOT break the
        tripple groups (numbers 0/1/2, 3/4/5, and 6/7/8) since the
        algorithms in
        KDChartPainter::setupGeometry() and
        KDChartPainter::paintHeaderFooter() rely on this schema.
        Also don't forget to always update the auxiliary values
        HdFtPosSTART, HdFtPosHeadersSTART,
        HdFtPosHeadersEND, HdFtPosFootersSTART,
        HdFtPosFootersEND, and HdFtPosEND muessen - these are used
        fpr other itarators...
        */
01993         enum HdFtPos{ // start of all sections
            HdFtPosSTART = 0,

            // headers:
            HdFtPosHeadersSTART  = 0,
            // top-most headers
            HdFtPosHeaders0START = 0,
            HdFtPosHeader0       = 0,
            HdFtPosHeader0L = 1,
            HdFtPosHeader0R      = 2,
            HdFtPosHeaders0END   = 2,
            // normal ( == middle ) headers
            HdFtPosHeaders1START = 3,
            HdFtPosHeader        = 3,        // center
            HdFtPosHeaderL = 4,              // left
            HdFtPosHeaderR       = 5,        // right
            HdFtPosHeaders1END   = 5,
            // bottom headers
            HdFtPosHeaders2START = 6,
            HdFtPosHeader2       = 6,
            HdFtPosHeader2L = 7,
            HdFtPosHeader2R      = 8,
            HdFtPosHeaders2END   = 8,

            HdFtPosHeadersEND = 8,

            // footers:
            HdFtPosFootersSTART = 9,
            // normal ( == middle ) footers
            HdFtPosFooters1START =  9,
            HdFtPosFooter        =  9,
            HdFtPosFooterL = 10,
            HdFtPosFooterR       = 11,
            HdFtPosFooters1END   = 11,
            // bottom footers
            HdFtPosFooters2START = 12,
            HdFtPosFooter2       = 12,
            HdFtPosFooter2L = 13,
            HdFtPosFooter2R      = 14,
            HdFtPosFooters2END   = 14,
            // top-most footers
            HdFtPosFooters0START = 15,
            HdFtPosFooter0       = 15,
            HdFtPosFooter0L = 16,
            HdFtPosFooter0R      = 17,
            HdFtPosFooters0END   = 17,

            HdFtPosFootersEND = 17,

            HdFtPosEND = 17 };


        void setHeaderFooterText( uint pos, const QString& text );
        QString headerFooterText( uint pos ) const;
        const QRect& headerFooterRect( uint pos ) const;
        void setHeaderFooterColor( uint pos, const QColor color );
        QColor headerFooterColor( uint pos ) const;
        void setHeaderFooterFont( uint pos, const QFont& font,
                bool fontUseRelSize,
                int fontRelSize );
        QFont headerFooterFont( uint pos ) const;
        bool headerFooterFontUseRelSize( uint pos ) const;
        int headerFooterFontRelSize( uint pos ) const;


        // quick&dirty functions: access Header, Header2 and Footer
        //                        without having to specify the HdFtPos
        //
        // This may be convenient for specifying simple charts with
        // up to two centered header(s) and up to one centered footer.


02065         void setHeader1Text( const QString& text )
        {
            _hdFtParams[ HdFtPosHeader ]._text = text;
            emit changed();
        }


02072         QString header1Text() const
        {
            return _hdFtParams[ HdFtPosHeader ]._text;
        }

02077         void setHeader1Font( const QFont& font )
        {
            _hdFtParams[ HdFtPosHeader ]._font = font;
            emit changed();
        }


02084         QFont header1Font() const
        {
            return _hdFtParams[ HdFtPosHeader ]._font;
        }

02089         void setHeader2Text( const QString& text )
        {
            _hdFtParams[ HdFtPosHeader2 ]._text = text;
            emit changed();
        }


02096         QString header2Text() const
        {
            return _hdFtParams[ HdFtPosHeader2 ]._text;
        }

02101         void setHeader2Font( const QFont& font )
        {
            _hdFtParams[ HdFtPosHeader2 ]._font = font;
            emit changed();
        }


02108         QFont header2Font() const
        {
            return _hdFtParams[ HdFtPosHeader2 ]._font;
        }



02115         void setFooterText( const QString& text )
        {
            _hdFtParams[ HdFtPosFooter ]._text = text;
            emit changed();
        }


02122         QString footerText() const
        {
            return _hdFtParams[ HdFtPosFooter ]._text;
        }

02127         void setFooterFont( const QFont& font )
        {
            _hdFtParams[ HdFtPosFooter ]._font = font;
            emit changed();
        }


02134         QFont footerFont() const
        {
            return _hdFtParams[ HdFtPosFooter ]._font;
        }


        /**
        \internal
        */
02143         void __internalStoreHdFtRect( int pos, QRect rect )
        {
            if ( 0 <= pos && HdFtPosEND >= pos )
                _hdFtParams[ pos ].setRect( rect );
        }


        // END HEADERS/FOOTERS




        KDChartParams();
        virtual ~KDChartParams();

        bool loadXML( const QDomDocument& doc );
        QDomDocument saveXML( bool withPI = true ) const;

        friend QTextStream& operator<<( QTextStream& s, const KDChartParams& p );
        friend QTextStream& operator>>( QTextStream& s, KDChartParams& p );

        static void createChartValueNode( QDomDocument& doc, QDomNode& parent,
                const QString& elementName,
                const KDChartData& data );
        static void createColorMapNode( QDomDocument& doc, QDomNode& parent,
                const QString& elementName,
                const QMap< uint, QColor >& map );
        static void createDoubleMapNode( QDomDocument& doc, QDomNode& parent,
                const QString& elementName,
                const QMap< int, double >& map );
        static void createChartFontNode( QDomDocument& doc, QDomNode& parent,
                const QString& elementName,
                const QFont& font, bool useRelFont,
                int relFont );
        static bool readColorMapNode( const QDomElement& element,
                QMap<uint,QColor>* map );
        static bool readDoubleMapNode( const QDomElement& element,
                QMap<int,double>* map );
        static bool readChartFontNode( const QDomElement& element, QFont& font,
                bool& useRelFont, int& relFontSize );
        static bool readChartValueNode( const QDomElement& element,
                KDChartData& value );


signals:
        void changed();


    private:
        void recomputeShadowColors();
        void insertDefaultAxisTitleBox( uint n,
                                        bool setTitle,       const QString& axisTitle,
                                        bool setColor,       const QColor& axisTitleColor,
                                        bool setFont,        const QFont& axisTitleFont,
                                        bool setFontUseRel,  bool useFontSize,
                                        bool setFontRelSize, int axisTitleFontRelSize );

        static QColor _internalPointer_DataValueAutoColor;

        bool _optimizeOutputForScreen;
02203         int _globalLeadingLeft;
02204         int _globalLeadingTop;
02205         int _globalLeadingRight;
02206         int _globalLeadingBottom;
02207         ChartType _chartType;
02208         ChartType _additionalChartType;
02209         int _numValues;
02210         QFont _defaultFont;

02212         typedef QMap < QString, KDChartFrameSettings > AreaMap;
02213         AreaMap _areaMap;

02215         CustomBoxMap _customBoxMap;
02216         QRect _noRect;
02217         KDFrame _noFrame;

02219         KDChartFrameSettings _noFrameSettings;

02221         class ModeAndChart
        {
            public:
                ModeAndChart()
                    : _mode( UnknownMode ), _chart( KDCHART_NO_CHART )
                    {}
                ModeAndChart( SourceMode mode, uint chart )
                    : _mode( mode ), _chart( chart )
                    {}

                SourceMode mode() const
                {
                    return _mode;
                };
                uint chart() const
                {
                    return _chart;
                };

                void setMode( SourceMode mode )
                {
                    _mode = mode;
                };
                void setChart( uint chart )
                {
                    _chart = chart;
                };
            private:
                SourceMode _mode;
                uint _chart;
        };

02253         typedef QMap < uint, ModeAndChart > ModeAndChartMap;
02254         ModeAndChartMap _dataSourceModeAndChart;
02255         bool _setChartSourceModeWasUsed;
02256         QMap < uint, QColor > _dataColors;
02257         uint _maxDatasetSourceMode;
02258         KDChartPropertySetList _propertySetList;
02259         double _shadowBrightnessFactor;
02260         Qt::BrushStyle _shadowPattern;
02261         bool _threeDShadowColors;
02262         uint _maxDatasetColor;
02263         QMap < uint, QColor > _dataColorsShadow1;
02264         QMap < uint, QColor > _dataColorsShadow2;
02265         QColor _outlineDataColor;
02266         uint _outlineDataLineWidth;
02267         PenStyle _outlineDataLineStyle;


        struct PrintDataValuesSettings {
            bool _printDataValues;
            int _divPow10;
            int _digitsBehindComma;
            QFont _dataValuesFont;
            bool _dataValuesUseFontRelSize;
            int _dataValuesFontRelSize;
            QColor _dataValuesColor;
            QBrush _dataValuesBrush;
            bool _dataValuesAutoColor;
            KDChartEnums::PositionFlag _dataValuesAnchorNegativePosition;
            uint _dataValuesAnchorNegativeAlign;
            int _dataValuesAnchorNegativeDeltaX;
            int _dataValuesAnchorNegativeDeltaY;
            int _dataValuesNegativeRotation;
            KDChartEnums::PositionFlag _dataValuesAnchorPositivePosition;
            uint _dataValuesAnchorPositiveAlign;
            int _dataValuesAnchorPositiveDeltaX;
            int _dataValuesAnchorPositiveDeltaY;
            int _dataValuesPositiveRotation;
            KDChartEnums::TextLayoutPolicy _dataValuesLayoutPolicy;
            bool _dataValuesShowInfinite;

            bool _useDefaultFontParams;  // internal flag, do NOT store it!
        };
02295         PrintDataValuesSettings _printDataValuesSettings;
02296         PrintDataValuesSettings _printDataValuesSettings2;

02298         bool _allowOverlappingDataValueTexts;
02299         BarChartSubType _barChartSubType;
02300         bool _threeDBars;
02301         int _threeDBarAngle;
02302         double _threeDBarDepth;
02303         double _cosThreeDBarAngle;
02304         int _datasetGap;
02305         bool _datasetGapIsRelative;
02306         int _valueBlockGap;
02307         bool _valueBlockGapIsRelative;
        bool _solidExcessArrows;

        // LINES/AREAS-specific
02311         LineChartSubType _lineChartSubType;
02312         bool _threeDLines;
02313         int _threeDLineDepth;
        int _threeDLineXRotation;
        int _threeDLineYRotation;
02316         bool _lineMarker;
02317         LineMarkerStyleMap _lineMarkerStyles;
02318         uint _maxDatasetLineMarkerStyle;
02319         QSize _lineMarkerSize;
02320         QColor _lineColor;
02321         int _lineWidth;
02322         PenStyle _lineStyle;
02323         AreaChartSubType _areaChartSubType;
02324         AreaLocation _areaLocation;


        // POLAR-specific
02328         PolarChartSubType _polarChartSubType;
02329         bool _polarMarker;
02330         PolarMarkerStyleMap _polarMarkerStyles;
02331         uint _maxDatasetPolarMarkerStyle;
02332         QSize _polarMarkerSize;
02333         int _polarLineWidth;
02334         int _polarZeroDegreePos;
02335         bool _polarRotateCircularLabels;
02336         struct _polarDelimsAndLabelStruct {
            bool showDelimiters;
            bool showLabels;
        };
02340         _polarDelimsAndLabelStruct _polarDelimsAndLabels[ 1 + MAX_POLAR_DELIMS_AND_LABELS_POS ];



        // PIES/RINGS
02345         bool _explode;
02346         double _explodeFactor;
02347         ExplodeFactorsMap _explodeFactors;
02348         QValueList<int> _explodeList;
02349         bool _threeDPies;
02350         int _threeDPieHeight;
02351         int _pieStart;
02352         int _ringStart;
02353         bool _relativeRingThickness;


        // HI-LO CHARTS

02358         HiLoChartSubType _hiLoChartSubType;
02359         bool _hiLoChartPrintLowValues;
02360         QFont _hiLoChartLowValuesFont;
02361         bool _hiLoChartLowValuesUseFontRelSize;
02362         int _hiLoChartLowValuesFontRelSize;
02363         QColor _hiLoChartLowValuesColor;
02364         bool _hiLoChartPrintHighValues;
02365         QFont _hiLoChartHighValuesFont;
02366         bool _hiLoChartHighValuesUseFontRelSize;
02367         int _hiLoChartHighValuesFontRelSize;
02368         QColor _hiLoChartHighValuesColor;
02369         bool _hiLoChartPrintOpenValues;
02370         QFont _hiLoChartOpenValuesFont;
02371         bool _hiLoChartOpenValuesUseFontRelSize;
02372         int _hiLoChartOpenValuesFontRelSize;
02373         QColor _hiLoChartOpenValuesColor;
02374         bool _hiLoChartPrintCloseValues;
02375         QFont _hiLoChartCloseValuesFont;
02376         bool _hiLoChartCloseValuesUseFontRelSize;
02377         int _hiLoChartCloseValuesFontRelSize;
02378         QColor _hiLoChartCloseValuesColor;



        // BOX AND WHISKER CHARTS

02384         BWChartSubType _BWChartSubType;

        struct BWChartStatistics {
            double value;
            int    y;
            bool   active;
            QFont  font;
            bool   useRelSize;
            int    relSize;
            QColor color;
            QBrush brush;
        };
02396         BWChartStatistics _BWChartStatistics[ BWStatValOffEndValue ];
        double _BWChartFenceUpperInner;
        double _BWChartFenceLowerInner;
        double _BWChartFenceUpperOuter;
02400         double _BWChartFenceLowerOuter;
02401         int _BWChartOutValMarkerSize;
02402         QBrush _BWChartBrush;


        // LEGENDS

02407         LegendPosition _legendPosition;
02408         LegendSource _legendSource;
02409         QMap < int, QString > _legendText;
02410         QColor _legendTextColor;
02411         QFont _legendFont;
02412         bool _legendFontUseRelSize;
02413         int _legendFontRelSize;
02414         QString _legendTitleText;
02415         QColor _legendTitleTextColor;
02416         QFont _legendTitleFont;
02417         bool _legendTitleFontUseRelSize;
02418         int _legendTitleFontRelSize;
02419         uint _legendSpacing;


        // AXES (private)
02423         struct AxisSettings
        {
            uint dataset;
            uint dataset2;
            uint chart;
            KDChartAxisParams params;
            AxisSettings()
            {
                dataset = KDCHART_NO_DATASET;
                dataset2 = KDCHART_NO_DATASET;
                chart = KDCHART_NO_CHART;
            }
        };

        // 13 == KDCHART_MAX_AXES + 1
02438         AxisSettings _axisSettings[ 13 ];
        // END AXES (private)


        // HEADER/FOOTER (private)

        struct HdFtParams
        {
            QString _text;
            QColor _color;
            QFont _font;
            bool _fontUseRelSize;
            int _fontRelSize;
            HdFtParams()
            {
                _color = QColor( Qt::black );
                _font = QFont( "helvetica", 10, QFont::Normal, false );
                _fontUseRelSize = true;
                _fontRelSize = 8; // per default quite small
            }
            void setRect( QRect rect )
            {
                _rect = rect;
            }
            const QRect& rect() const
            {
                return _rect;
            }
            private:
            // temporary data that are NOT to be stored within sessions:
            QRect _rect;
        };

        HdFtParams _hdFtParams[ HdFtPosEND + 1 ];
        // END HEADER/FOOTER (private)
};


QTextStream& operator<<( QTextStream& s, const KDChartParams& p );


QTextStream& operator>>( QTextStream& s, KDChartParams& p );


#endif

Generated by  Doxygen 1.6.0   Back to index