Logo Search packages:      
Sourcecode: koffice version File versions

QDomDocument KDChartParams::saveXML ( bool  withPI = true  )  const

Saves the parameters to an XML document.

Returns:
the XML document that represents the parameters
See also:
loadXML

Definition at line 54 of file KDChartParams_io.cpp.

References _additionalChartType, _allowOverlappingDataValueTexts, _areaChartSubType, _areaLocation, _areaMap, KDChartAxisParams::_axisLabelsFontRelSize, KDChartAxisParams::_axisLabelsFontUseRelSize, _axisSettings, _barChartSubType, _BWChartBrush, _BWChartFenceLowerOuter, _BWChartOutValMarkerSize, _BWChartStatistics, _BWChartSubType, _chartType, _customBoxMap, _dataColors, _dataColorsShadow1, _dataColorsShadow2, _datasetGap, _datasetGapIsRelative, _dataSourceModeAndChart, _explode, _explodeFactor, _explodeFactors, _explodeList, _globalLeadingBottom, _globalLeadingLeft, _globalLeadingRight, _globalLeadingTop, _hiLoChartCloseValuesColor, _hiLoChartCloseValuesFont, _hiLoChartCloseValuesFontRelSize, _hiLoChartCloseValuesUseFontRelSize, _hiLoChartHighValuesColor, _hiLoChartHighValuesFont, _hiLoChartHighValuesFontRelSize, _hiLoChartHighValuesUseFontRelSize, _hiLoChartLowValuesColor, _hiLoChartLowValuesFont, _hiLoChartLowValuesFontRelSize, _hiLoChartLowValuesUseFontRelSize, _hiLoChartOpenValuesColor, _hiLoChartOpenValuesFont, _hiLoChartOpenValuesFontRelSize, _hiLoChartOpenValuesUseFontRelSize, _hiLoChartPrintCloseValues, _hiLoChartPrintHighValues, _hiLoChartPrintLowValues, _hiLoChartPrintOpenValues, _hiLoChartSubType, _legendFont, _legendFontRelSize, _legendFontUseRelSize, _legendPosition, _legendSource, _legendSpacing, _legendText, _legendTextColor, _legendTitleFont, _legendTitleFontRelSize, _legendTitleFontUseRelSize, _legendTitleText, _legendTitleTextColor, _lineChartSubType, _lineColor, _lineMarker, _lineMarkerSize, _lineMarkerStyles, _lineStyle, _lineWidth, _maxDatasetColor, _maxDatasetSourceMode, _numValues, _outlineDataColor, _outlineDataLineStyle, _outlineDataLineWidth, _pieStart, _polarChartSubType, _polarLineWidth, _polarMarker, _polarMarkerSize, _polarMarkerStyles, _printDataValuesSettings, _printDataValuesSettings2, _propertySetList, _relativeRingThickness, _ringStart, _setChartSourceModeWasUsed, _shadowBrightnessFactor, _shadowPattern, _threeDBarDepth, _threeDBars, _threeDLineDepth, _threeDLines, _threeDPieHeight, _threeDPies, _threeDShadowColors, _valueBlockGap, _valueBlockGapIsRelative, areaChartSubTypeToString(), areaLocationToString(), KDChartAxisParams::AXIS_LABELS_AUTO_DELTA, KDChartAxisParams::AXIS_LABELS_AUTO_LIMIT, KDChartAxisParams::axisAreaModeToString(), KDChartAxisParams::axisCalcModeToString(), KDChartAxisParams::axisTypeToString(), barChartSubTypeToString(), bWChartStatValToString(), bWChartSubTypeToString(), chartSourceModeToString(), chartTypeToString(), createChartFontNode(), createChartValueNode(), createColorMapNode(), KDChartCustomBox::createCustomBoxNode(), createDoubleMapNode(), KDChartParams::KDChartFrameSettings::createFrameSettingsNode(), hiLoChartSubTypeToString(), KDChartAxisParams::labelsFromDataRowToString(), KDChartEnums::layoutPolicyToString(), legendPositionToString(), legendSourceToString(), lineChartSubTypeToString(), lineMarkerStyleToString(), KDChartParams::AxisSettings::params, polarChartSubTypeToString(), polarMarkerStyleToString(), and KDChartEnums::positionFlagToString().

Referenced by operator<<().

{
    // Create an inital DOM document
    QString docstart = "<ChartParams/>";

    QDomDocument doc( "ChartParams" );
    doc.setContent( docstart );
    if( withPI )
        doc.appendChild( doc.createProcessingInstruction( "xml", "version=\"1.0\" encoding=\"UTF-8\"" ) );

    QDomElement docRoot = doc.documentElement();
    docRoot.setAttribute( "xmlns", "http://www.klaralvdalens-datakonsult.se/kdchart" );
    docRoot.setAttribute( "xmlns:xsi", "http://www.w3.org/2000/10/XMLSchema-instance" );
    docRoot.setAttribute( "xsi:schemaLocation", "http://www.klaralvdalens-datakonsult.se/kdchart" );

    // the ChartType element
    QDomElement chartTypeElement = doc.createElement( "ChartType" );
    docRoot.appendChild( chartTypeElement );
    chartTypeElement.setAttribute( "primary",
            chartTypeToString( _chartType ) );
    chartTypeElement.setAttribute( "secondary",
            chartTypeToString( _additionalChartType ) );


    // the NumValues element
    KDXML::createIntNode( doc, docRoot, "NumValues", _numValues );

    // the ModeAndChartMap element
    QDomElement modeAndChartMapElement =
        doc.createElement( "ModeAndChartMap" );
    docRoot.appendChild( modeAndChartMapElement );
    for( QMap<uint,KDChartParams::ModeAndChart>::ConstIterator it = _dataSourceModeAndChart.begin();
            it != _dataSourceModeAndChart.end(); ++it ) {
        // Dataset element
        QDomElement datasetElement = doc.createElement( "Dataset" );
        QDomText datasetContent =
            doc.createTextNode( QString::number( it.key() ) );
        datasetElement.appendChild( datasetContent );
        modeAndChartMapElement.appendChild( datasetElement );
        // ModeAndChart element
        QDomElement modeAndChartElement = doc.createElement( "ModeAndChart" );
        modeAndChartElement.setAttribute( "Mode", chartSourceModeToString( it.data().mode() ) );
        modeAndChartElement.setAttribute( "Chart", it.data().chart() );
        modeAndChartMapElement.appendChild( modeAndChartElement );
    }

    // the PropertySetMap element
    QDomElement propertySetMapElement =
        doc.createElement( "PropertySetMap" );
    docRoot.appendChild( propertySetMapElement );
    for( KDChartPropertySetList::ConstIterator it2 = _propertySetList.begin();
            it2 != _propertySetList.end();
            ++it2 )
        propertySetMapElement.appendChild( it2.data().saveXML( doc ) );

    KDXML::createBoolNode( doc, docRoot, "ChartSourceModeWasUsed",
            _setChartSourceModeWasUsed );

    // the MaxDatasetSourceMode element
    KDXML::createIntNode( doc, docRoot, "MaxDatasetSourceMode",
            _maxDatasetSourceMode );

    // the ColorSettings element
    QDomElement colorSettingsElement =
        doc.createElement( "ColorSettings" );
    docRoot.appendChild( colorSettingsElement );

    {
        // the DataColors element
        createColorMapNode( doc, colorSettingsElement,
                "DataColors", _dataColors );

        // the MaxDatasetColor element
        KDXML::createIntNode( doc, colorSettingsElement, "MaxDatasetColor",
                _maxDatasetColor );

        // the ShadowBrightnessFactor element
        KDXML::createDoubleNode( doc, colorSettingsElement,
                "ShadowBrightnessFactor",
                _shadowBrightnessFactor );

        // the ShadowPattern element
        KDXML::createStringNode( doc, colorSettingsElement,
                "ShadowPattern",
                KDXML::brushStyleToString(_shadowPattern ) );

        // the ThreeDShadowColors element
        KDXML::createBoolNode( doc, colorSettingsElement,
                "ThreeDShadowColors",
                _threeDShadowColors );

        // the DataColorsShadow1 element
        createColorMapNode( doc, colorSettingsElement,
                "DataColorsShadow1",
                _dataColorsShadow1 );

        // the DataColorsShadow2 element
        createColorMapNode( doc, colorSettingsElement,
                "DataColorsShadow2",
                _dataColorsShadow2 );

        // the OutlineDataColor element
        KDXML::createColorNode( doc, colorSettingsElement,
                "OutlineDataColor",
                _outlineDataColor );

        // the OutlineDataLineWidth element
        KDXML::createIntNode( doc, colorSettingsElement,
                "OutlineDataLineWidth",
                _outlineDataLineWidth );

        // the OutlineDataLineStyle element
        QDomElement outlineDataLineStyleElement =
            doc.createElement( "OutlineDataLineStyle" );
        colorSettingsElement.appendChild( outlineDataLineStyleElement );
        outlineDataLineStyleElement.setAttribute( "Style",
                KDXML::penStyleToString( _outlineDataLineStyle ) );
    }


    // the BarSettings elemenet
    QDomElement barSettingsElement =
        doc.createElement( "BarSettings" );
    docRoot.appendChild( barSettingsElement );

    {
        // the SubType element
        KDXML::createStringNode( doc, barSettingsElement,
                "SubType", KDChartParams::barChartSubTypeToString( _barChartSubType ) );

        KDXML::createBoolNode( doc, barSettingsElement,
                "ThreeDBars", _threeDBars );

        KDXML::createDoubleNode( doc, barSettingsElement,
                "ThreeDBarDepth", _threeDBarDepth );

        KDXML::createIntNode( doc, barSettingsElement,
                "DatasetGap", _datasetGap );

        KDXML::createBoolNode( doc, barSettingsElement,
                "DatasetGapIsRelative", _datasetGapIsRelative );

        KDXML::createIntNode( doc, barSettingsElement,
                "ValueBlockGap", _valueBlockGap );

        KDXML::createBoolNode( doc, barSettingsElement,
                "ValueBlockGapIsRelative",
                _valueBlockGapIsRelative );

        KDXML::createBoolNode( doc, barSettingsElement,
                "SolidExcessArrows", _solidExcessArrows );
    }


    // the LineSettings element
    QDomElement lineSettingsElement =
        doc.createElement( "LineSettings" );
    docRoot.appendChild( lineSettingsElement );

    {
        // the SubType element
        KDXML::createStringNode( doc, lineSettingsElement,
                "SubType", KDChartParams::lineChartSubTypeToString( _lineChartSubType ) );

        // the Marker element
        KDXML::createBoolNode( doc, lineSettingsElement,
                "Marker", _lineMarker );

        // the MarkerStyles elements
        for( QMap<uint,KDChartParams::LineMarkerStyle>::ConstIterator it = _lineMarkerStyles.begin();
                it != _lineMarkerStyles.end(); ++it ) {
            QDomElement markerStyleElement = doc.createElement( "MarkerStyle" );
            lineSettingsElement.appendChild( markerStyleElement );
            markerStyleElement.setAttribute( "Dataset", it.key() );
            markerStyleElement.setAttribute( "Style", KDChartParams::lineMarkerStyleToString( it.data() ) );
        }

        // the MarkerSize element
        KDXML::createSizeNode( doc, lineSettingsElement,
                "MarkerSize", _lineMarkerSize );

        // the LineWidth element
        KDXML::createIntNode( doc, lineSettingsElement,
                "LineWidth", _lineWidth );

        // the LineColor element
        KDXML::createColorNode( doc, lineSettingsElement,
                "LineColor",
                _lineColor );

        // the LineStyle element
        QDomElement lineStyleElement =
            doc.createElement( "LineStyle" );
        lineSettingsElement.appendChild( lineStyleElement );
        lineStyleElement.setAttribute( "Style",
                KDXML::penStyleToString( _lineStyle ) );

        // the ThreeD element
        KDXML::createBoolNode( doc, lineSettingsElement,
                "ThreeD", _threeDLines );

        // the ThreeDDepth element
        KDXML::createIntNode( doc, lineSettingsElement,
                "ThreeDDepth", _threeDLineDepth );

        // the ThreeDXRotation element
        KDXML::createIntNode( doc, lineSettingsElement,
                "ThreeDXRotation", _threeDLineXRotation );

        // the ThreeDYRotation element
        KDXML::createIntNode( doc, lineSettingsElement,
                "ThreeDYRotation", _threeDLineYRotation );
    }


    // the AreaSettings element
    QDomElement areaSettingsElement =
        doc.createElement( "AreaSettings" );
    docRoot.appendChild( areaSettingsElement );

    {
        // the SubType element
        KDXML::createStringNode( doc, areaSettingsElement, "SubType",
                KDChartParams::areaChartSubTypeToString( _areaChartSubType ) );

        // the Location elemenet
        KDXML::createStringNode( doc, areaSettingsElement, "Location",
                KDChartParams::areaLocationToString( _areaLocation ) );
    }


    // the PieRingSettings element
    QDomElement pieRingSettingsElement =
        doc.createElement( "PieRingSettings" );
    docRoot.appendChild( pieRingSettingsElement );

    {
        // the Explode element
        KDXML::createBoolNode( doc, pieRingSettingsElement, "Explode",
                _explode );

        // the DefaultExplodeFactor element
        KDXML::createDoubleNode( doc, pieRingSettingsElement, "DefaultExplodeFactor",
                _explodeFactor );

        // the ExplodeFactors element
        createDoubleMapNode( doc, pieRingSettingsElement, "ExplodeFactors",
                _explodeFactors );

        // the ExplodeSegment element
        for( QValueList<int>::ConstIterator it = _explodeList.begin();
                it != _explodeList.end(); ++it )
            KDXML::createIntNode( doc, pieRingSettingsElement,
                    "ExplodeSegment", *it );

        // the ThreeDPies element
        KDXML::createBoolNode( doc, pieRingSettingsElement, "ThreeDPies",
                _threeDPies );

        // the ThreeDPieHeight element
        KDXML::createIntNode( doc, pieRingSettingsElement, "ThreeDPieHeight",
                _threeDPieHeight );

        // the PieStart element
        KDXML::createIntNode( doc, pieRingSettingsElement, "PieStart",
                _pieStart );

        // the RingStart element
        KDXML::createIntNode( doc, pieRingSettingsElement, "RingStart",
                _ringStart );

        // the RelativeRingThickness element
        KDXML::createBoolNode( doc, pieRingSettingsElement,
                "RelativeRingThickness", _relativeRingThickness );
    }

    // the HiLoSettings element
    QDomElement hiLoSettingsElement =
        doc.createElement( "HiLoSettings" );
    docRoot.appendChild( hiLoSettingsElement );
    {
        // the SubType element
        KDXML::createStringNode( doc, hiLoSettingsElement, "SubType",
                KDChartParams::hiLoChartSubTypeToString( _hiLoChartSubType ) );

        // the PrintLowValues element
        KDXML::createBoolNode( doc, hiLoSettingsElement, "PrintLowValues",
                _hiLoChartPrintLowValues );

        // the LowValuesFont element
        createChartFontNode( doc, hiLoSettingsElement, "LowValuesFont",
                _hiLoChartLowValuesFont,
                _hiLoChartLowValuesUseFontRelSize,
                _hiLoChartLowValuesFontRelSize );

        // the LowValuesColor element
        KDXML::createColorNode( doc, hiLoSettingsElement, "LowValuesColor",
                _hiLoChartLowValuesColor );

        // the PrintHighValues element
        KDXML::createBoolNode( doc, hiLoSettingsElement, "PrintHighValues",
                _hiLoChartPrintHighValues );

        // the HighValuesFont element
        createChartFontNode( doc, hiLoSettingsElement, "HighValuesFont",
                _hiLoChartHighValuesFont,
                _hiLoChartHighValuesUseFontRelSize,
                _hiLoChartHighValuesFontRelSize );

        // the HighValuesColor element
        KDXML::createColorNode( doc, hiLoSettingsElement, "HighValuesColor",
                _hiLoChartHighValuesColor );

        // the PrintOpenValues element
        KDXML::createBoolNode( doc, hiLoSettingsElement, "PrintOpenValues",
                _hiLoChartPrintOpenValues );

        // the OpenValuesFont element
        createChartFontNode( doc, hiLoSettingsElement, "OpenValuesFont",
                _hiLoChartOpenValuesFont,
                _hiLoChartOpenValuesUseFontRelSize,
                _hiLoChartOpenValuesFontRelSize );

        // the OpenValuesColor element
        KDXML::createColorNode( doc, hiLoSettingsElement, "OpenValuesColor",
                _hiLoChartOpenValuesColor );

        // the PrintCloseValues element
        KDXML::createBoolNode( doc, hiLoSettingsElement, "PrintCloseValues",
                _hiLoChartPrintCloseValues );

        // the CloseValuesFont element
        createChartFontNode( doc, hiLoSettingsElement, "CloseValuesFont",
                _hiLoChartCloseValuesFont,
                _hiLoChartCloseValuesUseFontRelSize,
                _hiLoChartCloseValuesFontRelSize );

        // the CloseValuesColor element
        KDXML::createColorNode( doc, hiLoSettingsElement, "CloseValuesColor",
                _hiLoChartCloseValuesColor );
    }



    // the BoxAndWhiskerSettings element
    QDomElement bWSettingsElement =
        doc.createElement( "BoxAndWhiskerSettings" );
    docRoot.appendChild( bWSettingsElement );
    {
        // the SubType element
        KDXML::createStringNode( doc, bWSettingsElement, "SubType",
                KDChartParams::bWChartSubTypeToString( _BWChartSubType ) );

        // the fences elements
        KDXML::createDoubleNode( doc, bWSettingsElement, "FenceUpperInner",
                _BWChartFenceUpperInner );
        KDXML::createDoubleNode( doc, bWSettingsElement, "FenceLowerInner",
                _BWChartFenceLowerInner );
        KDXML::createDoubleNode( doc, bWSettingsElement, "FenceUpperOuter",
                _BWChartFenceUpperInner );
        KDXML::createDoubleNode( doc, bWSettingsElement, "FenceLowerOuter",
                _BWChartFenceLowerOuter );

        // the brush to be used
        KDXML::createBrushNode( doc, bWSettingsElement, "Brush",
                _BWChartBrush );

        // the size of the outlier markers
        KDXML::createIntNode( doc, bWSettingsElement, "OutlierSize",
                _BWChartOutValMarkerSize );

        // the PrintStatistics elements
        for( int i = BWStatValSTART; i <= BWStatValEND; ++i ){
            QDomElement printStatElement =
                doc.createElement( "PrintStatistics"+bWChartStatValToString( (BWStatVal)i ) );
            KDXML::createBoolNode(  doc, printStatElement, "Active",
                    _BWChartStatistics[ i ].active );
            createChartFontNode(    doc, printStatElement, "Font",
                    _BWChartStatistics[ i ].font,
                    _BWChartStatistics[ i ].useRelSize,
                    _BWChartStatistics[ i ].relSize );
            KDXML::createColorNode( doc, printStatElement, "Color",
                    _BWChartStatistics[ i ].color );
            KDXML::createBrushNode( doc, printStatElement, "Brush",
                    _BWChartStatistics[ i ].brush );
        }
    }



    // the PolarSettings element
    QDomElement polarSettingsElement =
        doc.createElement( "PolarSettings" );
    docRoot.appendChild( polarSettingsElement );

    {
        // the SubType element
        KDXML::createStringNode( doc, polarSettingsElement,
                "SubType", KDChartParams::polarChartSubTypeToString( _polarChartSubType ) );

        // the Marker element
        KDXML::createBoolNode( doc, polarSettingsElement,
                "Marker", _polarMarker );

        // the MarkerStyles elements
        for( QMap<uint,KDChartParams::PolarMarkerStyle>::ConstIterator it = _polarMarkerStyles.begin();
                it != _polarMarkerStyles.end(); ++it ) {
            QDomElement markerStyleElement = doc.createElement( "MarkerStyle" );
            polarSettingsElement.appendChild( markerStyleElement );
            markerStyleElement.setAttribute( "Dataset", it.key() );
            markerStyleElement.setAttribute( "Style", KDChartParams::polarMarkerStyleToString( it.data() ) );
        }

        // the MarkerSize element
        KDXML::createSizeNode( doc, polarSettingsElement,
                "MarkerSize", _polarMarkerSize );

        // the PolarLineWidth element
        KDXML::createIntNode( doc, polarSettingsElement,
                "PolarLineWidth", _polarLineWidth );
    }



    // the LegendSettings element
    QDomElement legendSettingsElement =
        doc.createElement( "LegendSettings" );
    docRoot.appendChild( legendSettingsElement );
    {
        // the Position element
        KDXML::createStringNode( doc, legendSettingsElement, "Position",
                KDChartParams::legendPositionToString( _legendPosition ) );

        // the Source element
        KDXML::createStringNode( doc, legendSettingsElement, "Source",
                KDChartParams::legendSourceToString( _legendSource ) );

        // the Text elements
        for( QMap<int,QString>::ConstIterator it = _legendText.begin();
                it != _legendText.end(); ++it ) {
            QDomElement legendTextElement = doc.createElement( "LegendText" );
            legendSettingsElement.appendChild( legendTextElement );
            legendTextElement.setAttribute( "Dataset", it.key() );
            legendTextElement.setAttribute( "Text", it.data() );
        }

        // the TextColor element
        KDXML::createColorNode( doc, legendSettingsElement, "TextColor",
                _legendTextColor );

        // the TextFont element
        createChartFontNode( doc, legendSettingsElement, "TextFont",
                _legendFont,
                _legendFontUseRelSize,
                _legendFontRelSize );

        // the TitleText element
        KDXML::createStringNode( doc, legendSettingsElement, "TitleText",
                _legendTitleText );

        // the TitleColor element
        KDXML::createColorNode( doc, legendSettingsElement, "TitleColor",
                _legendTitleTextColor );

        // the TitleFont element
        createChartFontNode( doc, legendSettingsElement, "TitleFont",
                _legendTitleFont,
                _legendTitleFontUseRelSize,
                _legendTitleFontRelSize );

        // the Spacing element
        KDXML::createIntNode( doc, legendSettingsElement, "Spacing",
                _legendSpacing );
    }

    // the AxisSettings elements
    for( int axis = 0; axis < 13; axis++ ) {
        QDomElement axisSettingsElement =
            doc.createElement( "AxisSettings" );
        docRoot.appendChild( axisSettingsElement );
        axisSettingsElement.setAttribute( "Dataset",
                _axisSettings[axis].dataset );
        axisSettingsElement.setAttribute( "Dataset2",
                _axisSettings[axis].dataset2 );
        axisSettingsElement.setAttribute( "Chart",
                _axisSettings[axis].chart );
        {
            // the Type element
            KDXML::createStringNode( doc, axisSettingsElement, "Type",
                    KDChartAxisParams::axisTypeToString( _axisSettings[axis].params._axisType ) );

            // the Visible element
            KDXML::createBoolNode( doc, axisSettingsElement, "Visible",
                    _axisSettings[axis].params._axisVisible );

            // the LabelsTouchEdges element
            KDXML::createBoolNode( doc, axisSettingsElement, "LabelsTouchEdges",
                    _axisSettings[axis].params._axisLabelsTouchEdges );

            // the AreaMode element
            KDXML::createStringNode( doc, axisSettingsElement, "AreaMode",
                    KDChartAxisParams::axisAreaModeToString( _axisSettings[axis].params._axisAreaMode ) );

            // the UseAvailableSpaceFrom element
            KDXML::createIntNode( doc, axisSettingsElement, "UseAvailableSpaceFrom",
                    _axisSettings[axis].params._axisUseAvailableSpaceFrom );

            // the UseAvailableSpaceTo element
            KDXML::createIntNode( doc, axisSettingsElement, "UseAvailableSpaceTo",
                    _axisSettings[axis].params._axisUseAvailableSpaceTo );

            // the IsometricReferenceAxis element
            KDXML::createIntNode( doc, axisSettingsElement, "IsometricReferenceAxis",
                    _axisSettings[axis].params._axisIsoRefAxis );

            // the AreaMin element
            KDXML::createIntNode( doc, axisSettingsElement, "AreaMin",
                    _axisSettings[axis].params._axisAreaMin );

            // the AreaMax element
            KDXML::createIntNode( doc, axisSettingsElement, "AreaMax",
                    _axisSettings[axis].params._axisAreaMax );

            // the CalcMode element
            KDXML::createStringNode( doc, axisSettingsElement, "CalcMode",
                    KDChartAxisParams::axisCalcModeToString( _axisSettings[axis].params._axisCalcMode ) );

            // the TrueAreaSize element
            KDXML::createIntNode( doc, axisSettingsElement, "TrueAreaSize",
                    _axisSettings[axis].params._axisTrueAreaSize );

            // the TrueAreaRect element
            KDXML::createRectNode( doc, axisSettingsElement, "TrueAreaRect",
                    _axisSettings[axis].params._axisTrueAreaRect );

            // the ShowSubDelimiters element
            KDXML::createBoolNode( doc, axisSettingsElement, "ShowSubDelimiters",
                    _axisSettings[axis].params._axisShowSubDelimiters );

            // the LineVisible element
            KDXML::createBoolNode( doc, axisSettingsElement, "LineVisible",
                    _axisSettings[axis].params._axisLineVisible );

            // the LineWidth element
            KDXML::createIntNode( doc, axisSettingsElement, "LineWidth",
                    _axisSettings[axis].params._axisLineWidth );

            // the TrueLineWidth element
            KDXML::createIntNode( doc, axisSettingsElement, "TrueLineWidth",
                    _axisSettings[axis].params._axisTrueLineWidth );

            // the LineColor element
            KDXML::createColorNode( doc, axisSettingsElement, "LineColor",
                    _axisSettings[axis].params._axisLineColor );

            // the ShowGrid element
            KDXML::createBoolNode( doc, axisSettingsElement, "ShowGrid",
                    _axisSettings[axis].params._axisShowGrid );

            // the GridColor element
            KDXML::createColorNode( doc, axisSettingsElement, "GridColor",
                    _axisSettings[axis].params._axisGridColor );

            // the GridLineWidth element
            KDXML::createIntNode( doc, axisSettingsElement, "GridLineWidth",
                    _axisSettings[axis].params._axisGridLineWidth );

            // the GridStyle element
            KDXML::createStringNode( doc, axisSettingsElement, "GridStyle",
                    KDXML::penStyleToString( _axisSettings[axis].params._axisGridStyle ) );

            // the GridSubColor element
            KDXML::createColorNode( doc, axisSettingsElement, "GridSubColor",
                    _axisSettings[axis].params._axisGridSubColor );

            // the GridSubLineWidth element
            KDXML::createIntNode( doc, axisSettingsElement, "GridSubLineWidth",
                    _axisSettings[axis].params._axisGridSubLineWidth );

            // the GridSubStyle element
            KDXML::createStringNode( doc, axisSettingsElement, "GridSubStyle",
                    KDXML::penStyleToString( _axisSettings[axis].params._axisGridSubStyle ) );

            // the ZeroLineColor element
            KDXML::createColorNode( doc, axisSettingsElement, "ZeroLineColor",
                    _axisSettings[axis].params._axisZeroLineColor );

            // the LabelsVisible element
            KDXML::createBoolNode( doc, axisSettingsElement, "LabelsVisible",
                    _axisSettings[axis].params._axisLabelsVisible );

            // the LabelsFont element
            createChartFontNode( doc, axisSettingsElement, "LabelsFont",
                    _axisSettings[axis].params._axisLabelsFont,
                    _axisSettings[axis].params._axisLabelsFontUseRelSize,
                    _axisSettings[axis].params._axisLabelsFontRelSize );

            // the LabelsDontShrinkFont element
            KDXML::createBoolNode( doc, axisSettingsElement, "LabelsDontShrinkFont",
                    _axisSettings[axis].params._axisLabelsDontShrinkFont );

            // the LabelsDontAutoRotate element
            KDXML::createBoolNode( doc, axisSettingsElement, "LabelsDontAutoRotate",
                    _axisSettings[axis].params._axisLabelsDontAutoRotate );

            // the LabelsRotation element
            KDXML::createIntNode( doc, axisSettingsElement, "LabelsRotation",
                    _axisSettings[axis].params._axisLabelsRotation );

            // the LabelsLeaveOut element
            KDXML::createIntNode( doc, axisSettingsElement, "LabelsLeaveOut",
                    _axisSettings[axis].params._axisValueLeaveOut );

            // the LabelsColor element
            KDXML::createColorNode( doc, axisSettingsElement, "LabelsColor",
                    _axisSettings[axis].params._axisLabelsColor );

            // the SteadyValueCalc element
            KDXML::createBoolNode( doc, axisSettingsElement, "SteadyValueCalc",
                    _axisSettings[axis].params._axisSteadyValueCalc );

            // the ValueStart element
            if( ! ( KDChartAxisParams::AXIS_LABELS_AUTO_LIMIT == _axisSettings[axis].params._axisValueStart ))
                createChartValueNode( doc, axisSettingsElement, "ValueStart",
                        _axisSettings[axis].params._axisValueStart );

            // the ValueEnd element
            if( ! ( KDChartAxisParams::AXIS_LABELS_AUTO_LIMIT == _axisSettings[axis].params._axisValueEnd ))
                createChartValueNode( doc, axisSettingsElement, "ValueEnd",
                        _axisSettings[axis].params._axisValueEnd );

            // the ValueDelta element
            if( ! ( KDChartAxisParams::AXIS_LABELS_AUTO_DELTA == _axisSettings[axis].params._axisValueDelta ))
                KDXML::createDoubleNode( doc, axisSettingsElement, "ValueDelta",
                        _axisSettings[axis].params._axisValueDelta );
            KDXML::createIntNode( doc, axisSettingsElement, "ValueDeltaScale",
                    _axisSettings[axis].params._axisValueDeltaScale );

            // the TrueLow element
            KDXML::createDoubleNode( doc, axisSettingsElement, "TrueLow",
                    _axisSettings[axis].params._trueLow );

            // the TrueHigh element
            KDXML::createDoubleNode( doc, axisSettingsElement, "TrueHigh",
                    _axisSettings[axis].params._trueHigh );

            // the TrueDelta element
            KDXML::createDoubleNode( doc, axisSettingsElement, "TrueDelta",
                    _axisSettings[axis].params._trueDelta );

            // the ZeroLineStart element
            QDomElement zeroLineStartElement = doc.createElement( "ZeroLineStart" );
            axisSettingsElement.appendChild( zeroLineStartElement );
            zeroLineStartElement.setAttribute( "X", _axisSettings[axis].params._axisZeroLineStartX );
            zeroLineStartElement.setAttribute( "Y", _axisSettings[axis].params._axisZeroLineStartY );

            // the DigitsBehindComma element
            KDXML::createIntNode( doc, axisSettingsElement, "DigitsBehindComma",
                    _axisSettings[axis].params._axisDigitsBehindComma );

            // the LabelsDateTimeFormat element
            KDXML::createStringNode( doc, axisSettingsElement, "LabelsDateTimeFormat",
                    _axisSettings[axis].params._axisLabelsDateTimeFormat );

            // the MaxEmptyInnerSpan element
            KDXML::createIntNode( doc, axisSettingsElement, "MaxEmptyInnerSpan",
                    _axisSettings[axis].params._axisMaxEmptyInnerSpan );

            // the LabelsFromDataRow element
            KDXML::createStringNode( doc, axisSettingsElement, "LabelsFromDataRow",
                    KDChartAxisParams::labelsFromDataRowToString( _axisSettings[axis].params._takeLabelsFromDataRow ) );

            // the TextsDataRow element
            KDXML::createIntNode( doc, axisSettingsElement, "TextsDataRow",
                    _axisSettings[axis].params._labelTextsDataRow );

            // the LabelString elements
            KDXML::createStringListNodes( doc, axisSettingsElement, "LabelString",
                    &_axisSettings[axis].params._axisLabelStringList );

            // the ShortLabelString elements
            KDXML::createStringListNodes( doc, axisSettingsElement, "ShortLabelString",
                    &_axisSettings[axis].params._axisShortLabelsStringList );

            // the LabelText elements
            KDXML::createStringListNodes( doc, axisSettingsElement, "LabelText",
                    &_axisSettings[axis].params._axisLabelTexts );

            // the LabelTextsDirty element
            KDXML::createBoolNode( doc, axisSettingsElement, "LabelTextsDirty",
                    _axisSettings[axis].params._axisLabelTextsDirty );

            // the extra FirstLabelText element
            KDXML::createStringNode( doc, axisSettingsElement, "FirstLabelReplacementText",
                    _axisSettings[axis].params._axisFirstLabelText );

            // the extra LastLabelText element
            KDXML::createStringNode( doc, axisSettingsElement, "LastLabelReplacementText",
                    _axisSettings[axis].params._axisLastLabelText );

            // the LabelsDivPow10 element
            KDXML::createIntNode( doc, axisSettingsElement, "LabelsDivPow10",
                    _axisSettings[axis].params._axisLabelsDivPow10 );

            // the LabelsDecimalPoint element
            KDXML::createStringNode( doc, axisSettingsElement, "LabelsDecimalPoint",
                    _axisSettings[axis].params._axisLabelsDecimalPoint );

            // the LabelsThousandsPoint element
            KDXML::createStringNode( doc, axisSettingsElement, "LabelsThousandsPoint",
                    _axisSettings[axis].params._axisLabelsThousandsPoint );

            // the LabelsPrefix element
            KDXML::createStringNode( doc, axisSettingsElement, "LabelsPrefix",
                    _axisSettings[axis].params._axisLabelsPrefix );

            // the LabelsPostfix element
            KDXML::createStringNode( doc, axisSettingsElement, "LabelsPostfix",
                    _axisSettings[axis].params._axisLabelsPostfix );

            // the LabelsTotalLen element
            KDXML::createIntNode( doc, axisSettingsElement, "LabelsTotalLen",
                    _axisSettings[axis].params._axisLabelsTotalLen );

            // the LabelsPadFill element
            KDXML::createStringNode( doc, axisSettingsElement, "LabelsPadFill",
                    _axisSettings[axis].params._axisLabelsPadFill );

            // the LabelsBlockAlign element
            KDXML::createBoolNode( doc, axisSettingsElement, "LabelsBlockAlign",
                    _axisSettings[axis].params._axisLabelsBlockAlign );
        }
    }

    // the HeaderFooterSettings elements
    for( int hf = 0; hf < 18; hf++ ) {
        QDomElement hfSettingsElement =
            doc.createElement( "HeaderFooterSettings" );
        docRoot.appendChild( hfSettingsElement );
        {
            KDXML::createStringNode( doc, hfSettingsElement, "Text",
                    _hdFtParams[hf]._text );
            createChartFontNode( doc, hfSettingsElement, "Font",
                    _hdFtParams[hf]._font,
                    _hdFtParams[hf]._fontUseRelSize,
                    _hdFtParams[hf]._fontRelSize );
            KDXML::createColorNode( doc, hfSettingsElement, "Color",
                    _hdFtParams[hf]._color );
        }
    }


            // labels formatting:

    // the GlobalLeading element
    QDomElement globalLeadingElement =
        doc.createElement( "GlobalLeading" );
    docRoot.appendChild( legendSettingsElement );
    {
        KDXML::createIntNode( doc, globalLeadingElement, "Left",
                _globalLeadingLeft );
        KDXML::createIntNode( doc, globalLeadingElement, "Top",
                _globalLeadingTop );
        KDXML::createIntNode( doc, globalLeadingElement, "Right",
                _globalLeadingRight );
        KDXML::createIntNode( doc, globalLeadingElement, "Bottom",
                _globalLeadingBottom );
    }

    // the DataValuesSettings1 element
    QDomElement dataValuesSettings1Element =
        doc.createElement( "DataValuesSettings1" );
    docRoot.appendChild( dataValuesSettings1Element );
    {
        KDXML::createBoolNode( doc, dataValuesSettings1Element, "PrintDataValues",
                _printDataValuesSettings._printDataValues );
        KDXML::createIntNode( doc, dataValuesSettings1Element, "DivPow10",
                _printDataValuesSettings._divPow10 );
        KDXML::createIntNode( doc, dataValuesSettings1Element, "DigitsBehindComma",
                _printDataValuesSettings._digitsBehindComma );
        createChartFontNode( doc, dataValuesSettings1Element, "Font",
                _printDataValuesSettings._dataValuesFont,
                _printDataValuesSettings._dataValuesUseFontRelSize,
                _printDataValuesSettings._dataValuesFontRelSize );
        KDXML::createColorNode( doc, dataValuesSettings1Element, "Color",
                _printDataValuesSettings._dataValuesColor );
        KDXML::createBrushNode( doc, dataValuesSettings1Element, "Background",
                _printDataValuesSettings._dataValuesBrush );
        KDXML::createBoolNode( doc, dataValuesSettings1Element, "AutoColor",
                _printDataValuesSettings._dataValuesAutoColor );
        KDXML::createStringNode( doc, dataValuesSettings1Element,
                "AnchorNegativePosition",
                KDChartEnums::positionFlagToString( _printDataValuesSettings._dataValuesAnchorNegativePosition ) );
        KDXML::createIntNode( doc, dataValuesSettings1Element,
                "AnchorNegativeAlign",
                _printDataValuesSettings._dataValuesAnchorNegativeAlign );
        KDXML::createIntNode( doc, dataValuesSettings1Element,
                "AnchorNegativeDeltaX",
                _printDataValuesSettings._dataValuesAnchorNegativeDeltaX );
        KDXML::createIntNode( doc, dataValuesSettings1Element,
                "AnchorNegativeDeltaY",
                _printDataValuesSettings._dataValuesAnchorNegativeDeltaY );
        KDXML::createIntNode( doc, dataValuesSettings1Element,
                "NegativeRotation",
                _printDataValuesSettings._dataValuesNegativeRotation );
        KDXML::createStringNode( doc, dataValuesSettings1Element,
                "AnchorPositivePosition",
                KDChartEnums::positionFlagToString( _printDataValuesSettings._dataValuesAnchorPositivePosition ) );
        KDXML::createIntNode( doc, dataValuesSettings1Element,
                "AnchorPositiveAlign",
                _printDataValuesSettings._dataValuesAnchorPositiveAlign );
        KDXML::createIntNode( doc, dataValuesSettings1Element,
                "AnchorPositiveDeltaX",
                _printDataValuesSettings._dataValuesAnchorPositiveDeltaX );
        KDXML::createIntNode( doc, dataValuesSettings1Element,
                "AnchorPositiveDeltaY",
                _printDataValuesSettings._dataValuesAnchorPositiveDeltaY );
        KDXML::createIntNode( doc, dataValuesSettings1Element,
                "PositiveRotation",
                _printDataValuesSettings._dataValuesPositiveRotation );

        KDXML::createStringNode( doc, dataValuesSettings1Element,
                "LayoutPolicy",
                KDChartEnums::layoutPolicyToString( _printDataValuesSettings._dataValuesLayoutPolicy ) );

        KDXML::createBoolNode( doc, dataValuesSettings1Element, "ShowInfinite",
                               _printDataValuesSettings._dataValuesShowInfinite );
    }

    // the DataValuesSettings2 element
    QDomElement dataValuesSettings2Element =
        doc.createElement( "DataValuesSettings2" );
    docRoot.appendChild( dataValuesSettings2Element );
    {
        KDXML::createBoolNode( doc, dataValuesSettings2Element, "PrintDataValues",
                _printDataValuesSettings2._printDataValues );
        KDXML::createIntNode( doc, dataValuesSettings2Element, "DivPow10",
                _printDataValuesSettings2._divPow10 );
        KDXML::createIntNode( doc, dataValuesSettings2Element, "DigitsBehindComma",
                _printDataValuesSettings2._digitsBehindComma );
        createChartFontNode( doc, dataValuesSettings2Element, "Font",
                _printDataValuesSettings2._dataValuesFont,
                _printDataValuesSettings2._dataValuesUseFontRelSize,
                _printDataValuesSettings2._dataValuesFontRelSize );
        KDXML::createColorNode( doc, dataValuesSettings2Element, "Color",
                _printDataValuesSettings2._dataValuesColor );
        KDXML::createBrushNode( doc, dataValuesSettings2Element, "Background",
                _printDataValuesSettings2._dataValuesBrush );
        KDXML::createBoolNode( doc, dataValuesSettings2Element, "AutoColor",
                _printDataValuesSettings2._dataValuesAutoColor );
        KDXML::createStringNode( doc, dataValuesSettings2Element,
                "AnchorNegativePosition",
                KDChartEnums::positionFlagToString( _printDataValuesSettings2._dataValuesAnchorNegativePosition ) );
        KDXML::createIntNode( doc, dataValuesSettings2Element,
                "AnchorNegativeAlign",
                _printDataValuesSettings2._dataValuesAnchorNegativeAlign );
        KDXML::createIntNode( doc, dataValuesSettings2Element,
                "AnchorNegativeDeltaX",
                _printDataValuesSettings2._dataValuesAnchorNegativeDeltaX );
        KDXML::createIntNode( doc, dataValuesSettings2Element,
                "AnchorNegativeDeltaY",
                _printDataValuesSettings2._dataValuesAnchorNegativeDeltaY );
        KDXML::createIntNode( doc, dataValuesSettings2Element,
                "NegativeRotation",
                _printDataValuesSettings2._dataValuesNegativeRotation );
        KDXML::createStringNode( doc, dataValuesSettings2Element,
                "AnchorPositivePosition",
                KDChartEnums::positionFlagToString( _printDataValuesSettings2._dataValuesAnchorPositivePosition ) );
        KDXML::createIntNode( doc, dataValuesSettings2Element,
                "AnchorPositiveAlign",
                _printDataValuesSettings2._dataValuesAnchorPositiveAlign );
        KDXML::createIntNode( doc, dataValuesSettings2Element,
                "AnchorPositiveDeltaX",
                _printDataValuesSettings2._dataValuesAnchorPositiveDeltaX );
        KDXML::createIntNode( doc, dataValuesSettings2Element,
                "AnchorPositiveDeltaY",
                _printDataValuesSettings2._dataValuesAnchorPositiveDeltaY );
        KDXML::createIntNode( doc, dataValuesSettings2Element,
                "PositiveRotation",
                _printDataValuesSettings2._dataValuesPositiveRotation );

        KDXML::createStringNode( doc, dataValuesSettings2Element,
                "LayoutPolicy",
                KDChartEnums::layoutPolicyToString( _printDataValuesSettings2._dataValuesLayoutPolicy ) );

        KDXML::createBoolNode( doc, dataValuesSettings2Element, "ShowInfinite",
                               _printDataValuesSettings2._dataValuesShowInfinite );
    }

    // global settings for data value settings of _all_ charts
    QDomElement dataValuesGlobalSettingsElement =
        doc.createElement( "DataValuesGlobalSettings" );
    docRoot.appendChild( dataValuesGlobalSettingsElement );
    {
        KDXML::createBoolNode( doc, dataValuesGlobalSettingsElement,
                "allowOverlappingTexts",
                _allowOverlappingDataValueTexts );
    }

    // the AreaMap element
    QDomElement areaMapElement =
        doc.createElement( "AreaMap" );
    docRoot.appendChild( areaMapElement );
    {
        for( QMap<QString,KDChartFrameSettings>::ConstIterator it = _areaMap.begin();
                it != _areaMap.end(); ++it ) {
            KDChartFrameSettings::createFrameSettingsNode( doc, areaMapElement,
                    "FrameSettings",
                    &(it.data()),
                    it.key().left(5).stripWhiteSpace().toUInt() );
        }
    }

    // the CustomBoxMap element
    QDomElement customBoxMapElement =
        doc.createElement( "CustomBoxMap" );
    docRoot.appendChild( customBoxMapElement );
    {
        for( QMap<uint,KDChartCustomBox>::ConstIterator it = _customBoxMap.begin();
                it != _customBoxMap.end(); ++it ) {
            KDXML::createIntNode( doc, customBoxMapElement, "Number", it.key() );
            KDChartCustomBox::createCustomBoxNode( doc, customBoxMapElement,
                    "CustomBox", &(it.data()) );
        }
    }


    return doc;
}


Generated by  Doxygen 1.6.0   Back to index