Logo Search packages:      
Sourcecode: koffice version File versions

KDChartParams::KDChartParams (  ) 

Constructor. Defines default values.

Definition at line 87 of file KDChartParams.cpp.

References _defaultFont, _maxDatasetColor, _maxDatasetLineMarkerStyle, _maxDatasetPolarMarkerStyle, _maxDatasetSourceMode, _noFrame, _noFrameSettings, _printDataValuesSettings, _printDataValuesSettings2, _setChartSourceModeWasUsed, activateDefaultAxes(), KDFrame::clearAll(), KDCHART_PROPSET_HORI_LINE, KDCHART_PROPSET_NORMAL_DATA, KDCHART_PROPSET_TRANSPARENT_DATA, KDCHART_PROPSET_VERT_LINE, setAdditionalChartType(), setAllowOverlappingDataValueTexts(), setAreaChartSubType(), setAreaLocation(), setBarChartSubType(), setBWChartBrush(), setBWChartFences(), setBWChartOutValMarkerSize(), setBWChartPrintStatistics(), setBWChartSubType(), setChartType(), setDataDefaultColors(), setDatasetGap(), setDatasetGapIsRelative(), setDefaultAxesTypes(), setDrawSolidExcessArrows(), setExplode(), setExplodeFactor(), setGlobalLeading(), setHeaderFooterFont(), setHiLoChartPrintCloseValues(), setHiLoChartPrintHighValues(), setHiLoChartPrintLowValues(), setHiLoChartPrintOpenValues(), setHiLoChartSubType(), setLegendFont(), setLegendFontRelSize(), setLegendPosition(), setLegendSource(), setLegendSpacing(), setLegendTextColor(), setLegendTitleFont(), setLegendTitleFontRelSize(), setLegendTitleText(), setLegendTitleTextColor(), setLineChartSubType(), setLineColor(), setLineMarker(), setLineMarkerSize(), setLineMarkerStyle(), setLineStyle(), setLineWidth(), setNumValues(), setOptimizeOutputForScreen(), setOutlineDataColor(), setOutlineDataLineStyle(), setOutlineDataLineWidth(), setPieStart(), setPolarChartSubType(), setPolarDelimsAndLabelsAtPos(), setPolarLineWidth(), setPolarMarker(), setPolarMarkerSize(), setPolarMarkerStyle(), setPolarRotateCircularLabels(), setPolarZeroDegreePos(), setPrintDataValuesWithDefaultFontParams(), setProperties(), setRelativeRingThickness(), setRingStart(), setShadowBrightnessFactor(), setShadowPattern(), setThreeDBarAngle(), setThreeDBarDepth(), setThreeDBars(), setThreeDBarsShadowColors(), setThreeDLineDepth(), setThreeDLines(), setThreeDLineXRotation(), setThreeDLineYRotation(), setThreeDPieHeight(), setThreeDPies(), setValueBlockGap(), and setValueBlockGapIsRelative().

{
    // GENERAL

    // Avoid Purify UMR
    _maxDatasetColor = 0;
    _maxDatasetSourceMode = 0;
    _setChartSourceModeWasUsed = false;

    // Set the default font params flag for data value texts
    // but do *not* call setPrintDataValues() there since
    // this will be called internally by setChartType() below.
    setPrintDataValuesWithDefaultFontParams( KDCHART_ALL_CHARTS, false );
    _printDataValuesSettings._dataValuesShowInfinite  = true;
    _printDataValuesSettings2._dataValuesShowInfinite = true;

    setAllowOverlappingDataValueTexts( false );

    setOptimizeOutputForScreen( true );

    setGlobalLeading( 0,0,0,0 );


    // Default type is bar charts
    setChartType( Bar );

    // By default, there is no additional chart type
    setAdditionalChartType( NoType );

    // Default is to show all values.
    setNumValues( static_cast<unsigned int>( -1 ) );

    _defaultFont = QFont( "helvetica", 8, QFont::Normal, false );

    // The default frame settings: no border, no corners, no background
    _noFrame.clearAll();

    // The default frame settings: no inner gap, no outer gap and use the _noFrame
    _noFrameSettings = KDChartFrameSettings();

    // The default brightness of shadow colors (needs to be set
    // before the data colors to avoid an UMR).
    setShadowBrightnessFactor( 1.0 );

    // The default shadow fill style.
    setShadowPattern( Qt::SolidPattern );

    // Some default colors for the data.
    setDataDefaultColors();

    // Default color for data display outlines.
    setOutlineDataColor( black );

    // Default line width for data display outlines.
    setOutlineDataLineWidth( 1 );

    // Default line style for data display outlines.
    setOutlineDataLineStyle( Qt::SolidLine );

    // END GENERAL



    // BAR CHART-SPECIFIC

    // Default bar subtype is normal
    setBarChartSubType( BarNormal );

    // Default is not to draw 3D bars
    setThreeDBars( false );

    // Default is to used shadowed colors for 3D bar effects
    setThreeDBarsShadowColors( true );

    // Default angle for 3D bars is 45 degrees.
    setThreeDBarAngle( 45 );

    // Default depth of 3D bars is 1.0
    setThreeDBarDepth( 1.0 );

    // Default gap between datasets is 6 per mille of chart data area.
    setDatasetGap( 6 );
    setDatasetGapIsRelative( true );

    // Default gap between value blocks is 24 per mille of chart data area.
    setValueBlockGap( 24 );
    setValueBlockGapIsRelative( true );

    // By default, excess arrows are drawn in a split fashion
    setDrawSolidExcessArrows( false );

    // END BAR CHART-SPECIFIC


    // LINE/AREA CHART-SPECIFIC
    // Normal lines by default
    setLineChartSubType( LineNormal );

    // No markers by default
    setLineMarker( false );

    // Lines have a width of 1 pixel by default
    setLineWidth( 1 );

    // Lines are solid by default
    setLineStyle( Qt::SolidLine );

    // Lines have the same color as their
    // respective data points by default
    setLineColor();


    // Default line marker styles and size
    _maxDatasetLineMarkerStyle = 0; // avoid UMR
    setLineMarkerStyle( 0, LineMarkerCircle );
    setLineMarkerStyle( 1, LineMarkerSquare );
    setLineMarkerStyle( 2, LineMarkerDiamond );
    setLineMarkerSize( QSize( 6, 6 ) );

    // 3D line settings
    setThreeDLines( false );
    setThreeDLineDepth( 20 );
    /* temporary disabled:
       setThreeDLineXRotation( 30 );
       setThreeDLineYRotation( 30 );
       */
    setThreeDLineXRotation( 15 );
    setThreeDLineYRotation( 15 );

    // Normal areas by default
    setAreaChartSubType( AreaNormal );

    // Areas are filled below the value points by default.
    setAreaLocation( AreaBelow );

    // END LINE/AREA CHART-SPECIFIC

    // POLAR CHART-SPECIFIC
    // Normal polar charts by default
    setPolarChartSubType( PolarNormal );

    // Have markers by default
    setPolarMarker( true );

    // Polar charts show the zero point at the right side of the circle
    setPolarZeroDegreePos( 0 );

    // Lines have a width of 3/1000 of the chart's min size
    // (either width or height) by default
    setPolarLineWidth( -3 );

    // Default polar marker styles and size
    _maxDatasetPolarMarkerStyle = 0; // avoid UMR
    setPolarMarkerStyle( 0, PolarMarkerCircle );
    setPolarMarkerStyle( 1, PolarMarkerSquare );
    setPolarMarkerStyle( 2, PolarMarkerDiamond );
    setPolarMarkerSize( QSize( -40,-40 ) );

    // default circular axes delimiters
    setPolarRotateCircularLabels( false );
    setPolarDelimsAndLabelsAtPos( KDChartEnums::PosTopLeft,      false, false );
    setPolarDelimsAndLabelsAtPos( KDChartEnums::PosTopCenter,    true,  true  );
    setPolarDelimsAndLabelsAtPos( KDChartEnums::PosTopRight,     false, false );

    setPolarDelimsAndLabelsAtPos( KDChartEnums::PosCenterLeft,   false, false );
    setPolarDelimsAndLabelsAtPos( KDChartEnums::PosCenterRight,  false, false );

    setPolarDelimsAndLabelsAtPos( KDChartEnums::PosBottomLeft,   false, false );
    setPolarDelimsAndLabelsAtPos( KDChartEnums::PosBottomCenter, true,  true  );
    setPolarDelimsAndLabelsAtPos( KDChartEnums::PosBottomRight,  false, false );


    /* for test:
       setPolarDelimsAndLabelsAtPos( KDChartEnums::PosTopLeft,      true, true );
       setPolarDelimsAndLabelsAtPos( KDChartEnums::PosTopCenter,    true, true  );
       setPolarDelimsAndLabelsAtPos( KDChartEnums::PosTopRight,     true, true );
       setPolarDelimsAndLabelsAtPos( KDChartEnums::PosCenterRight,  true, true );
       setPolarDelimsAndLabelsAtPos( KDChartEnums::PosBottomRight,  true, true );
       setPolarDelimsAndLabelsAtPos( KDChartEnums::PosBottomCenter, true, true  );
       setPolarDelimsAndLabelsAtPos( KDChartEnums::PosBottomLeft,   true, true );
       setPolarDelimsAndLabelsAtPos( KDChartEnums::PosCenterLeft,   true, true );
       */


    // END POLAR CHART-SPECIFIC

    // PIE/RING CHART-SPECIFIC
    // Pie/ring charts do not explode by default.
    setExplode( false );
    // But if they do, the explode factor is 10%
    setExplodeFactor( 0.1 );
    // setExplodeValues() is not called for initialization, the default
    // empty list is the default.
    // Flat pies by default
    setThreeDPies( false );
    // Height of 3D effect
    setThreeDPieHeight( 20 );
    // Start of pie circle
    setPieStart( 0 );
    // Start of ring circle
    setRingStart( 0 );
    // Ring thickness is constant by default
    setRelativeRingThickness( false );
    // END PIE/RING CHART-SPECIFIC


    // HILO CHART-SPECIFIC
    // Simple HiLo charts by default
    setHiLoChartSubType( KDChartParams::HiLoSimple );
    setHiLoChartPrintLowValues( false );
    setHiLoChartPrintHighValues( false );
    setHiLoChartPrintOpenValues( false );
    setHiLoChartPrintCloseValues( false );


    // BOX+WHISKER CHART-SPECIFIC
    // Simple Box-and-Whisker charts by default
    setBWChartSubType( KDChartParams::BWSimple );
    setBWChartFences(1.5, 1.5,  3.0, 3.0);
    setBWChartOutValMarkerSize( -25 );
    setBWChartPrintStatistics( BWStatValALL, false );
    setBWChartBrush( Qt::white );

    // LEGEND
    // Distance between legend and data.
    setLegendSpacing( 20 );
    // Position of the legend
    setLegendPosition( LegendRight );
    // Where the legend labels come from
    setLegendSource( LegendAutomatic );
    // legend texts are drawn in black by default
    setLegendTextColor( Qt::black );
    // legend font size is calculated dynamically, but ignore the font size
    setLegendFont( QFont( "helvetica", 10, QFont::Normal, false ), false );
    // legend font size is calculated dynamically:
    //                    20 / 1000 of the average value of
    //                                 the printable area height and width
    setLegendFontRelSize( 22 );
    // the default legend title is "Legend"
    setLegendTitleText( tr( "Legend" ) );
    // legend title is drawn in black by default
    setLegendTitleTextColor( Qt::black );
    // legend title font size is calculated dynamically, but ignore
    // the font size
    setLegendTitleFont( QFont( "helvetica", 12, QFont::Normal, false ), false );
    // legend title font size is calculated dynamically:
    //                    25 / 1000 of the average value of
    //                                 the printable area height and width
    setLegendTitleFontRelSize( 28 );
    // END LEGEND


    // AXES

    setDefaultAxesTypes();
    // activate bottom (ordinate) and left (abcissa) axis
    activateDefaultAxes();

    // END AXES


    // HEADERS/FOOTERS

    // Set a default font for all sections not taking the build-in
    // defaults from c'tor KDChartParams::HdFtParams::HdFtParams()
    QFont defaultHdFtFont( "helvetica", 14, QFont::Normal, false );
    int relHd0Size = 18;
    int relHdSize  = 30;
    int relHd2Size = 24;

    int relFt0Size = 18;
    int relFtSize  = 24;
    int relFt2Size = 16;
    setHeaderFooterFont( KDChartParams::HdFtPosHeader0,
            defaultHdFtFont, true, relHd0Size );
    setHeaderFooterFont( KDChartParams::HdFtPosHeader0L,
            defaultHdFtFont, true, relHd0Size );
    setHeaderFooterFont( KDChartParams::HdFtPosHeader0R,
            defaultHdFtFont, true, relHd0Size );
    setHeaderFooterFont( KDChartParams::HdFtPosHeader,
            defaultHdFtFont, true, relHdSize );
    setHeaderFooterFont( KDChartParams::HdFtPosHeaderL,
            defaultHdFtFont, true, relHdSize );
    setHeaderFooterFont( KDChartParams::HdFtPosHeaderR,
            defaultHdFtFont, true, relHdSize );
    setHeaderFooterFont( KDChartParams::HdFtPosHeader2,
            defaultHdFtFont, true, relHd2Size );
    setHeaderFooterFont( KDChartParams::HdFtPosHeader2L,
            defaultHdFtFont, true, relHd2Size );
    setHeaderFooterFont( KDChartParams::HdFtPosHeader2R,
            defaultHdFtFont, true, relHd2Size );

    setHeaderFooterFont( KDChartParams::HdFtPosFooter0,
            defaultHdFtFont, true, relFt0Size );
    setHeaderFooterFont( KDChartParams::HdFtPosFooter0L,
            defaultHdFtFont, true, relFt0Size );
    setHeaderFooterFont( KDChartParams::HdFtPosFooter0R,
            defaultHdFtFont, true, relFt0Size );
    setHeaderFooterFont( KDChartParams::HdFtPosFooter,
            defaultHdFtFont, true, relFtSize );
    setHeaderFooterFont( KDChartParams::HdFtPosFooterL,
            defaultHdFtFont, true, relFtSize );
    setHeaderFooterFont( KDChartParams::HdFtPosFooterR,
            defaultHdFtFont, true, relFtSize );
    setHeaderFooterFont( KDChartParams::HdFtPosFooter2,
            defaultHdFtFont, true, relFt2Size );
    setHeaderFooterFont( KDChartParams::HdFtPosFooter2L,
            defaultHdFtFont, true, relFt2Size );
    setHeaderFooterFont( KDChartParams::HdFtPosFooter2R,
            defaultHdFtFont, true, relFt2Size );
    // END HEADERS/FOOTERS

    // PROPERTY SETS
    KDChartPropertySet set("normal data");
    setProperties(KDCHART_PROPSET_NORMAL_DATA, set);
    // don't show the line, don't show the marker
    set.setName("transparent data");
    set.setLineStyle(  KDChartPropertySet::OwnID, Qt::NoPen );
    set.setShowMarker( KDChartPropertySet::OwnID, false );
    setProperties(KDCHART_PROPSET_TRANSPARENT_DATA, set);
    // don't show line nor marker, but do show the horizontal line
    set.setName("horizontal line");
    set.setExtraLinesAlign(  KDChartPropertySet::OwnID, Qt::AlignLeft | Qt::AlignRight );
    setProperties(KDCHART_PROPSET_HORI_LINE, set);
    // don't show line nor marker, but do show the vertical line
    set.setName("vertical line");
    set.setExtraLinesAlign(  KDChartPropertySet::OwnID, Qt::AlignTop | Qt::AlignBottom );
    setProperties(KDCHART_PROPSET_VERT_LINE, set);
    // END PROPERTY SETS
}


Generated by  Doxygen 1.6.0   Back to index