/** This class implements the calculation of automatic axis limits. * *Thisclassisusedforcalculatingaxisscalesandincrementsintheform *ofinstancesof`ExplicitScaleData`and`ExplicitIncrementData`classes. *Whena`ScaleAutomatism`instanceiscreateda`ScaleData`objectispassed *totheconstructor.Objectsof`ScaleData`typeareinitializedby *the`createCoordinateSystem`methodofsomecharttype(e.g. *the`PieChartType`class)andbelongtosome`Axis`object,theycanbe *accessedthroughthe`XAxis`interface(`XAxis::getScaleData`).
*/ class ScaleAutomatism
{ public: explicit ScaleAutomatism( const css::chart2::ScaleData& rSourceScale, const Date& rNullDate );
/** Expands own value range with the passed minimum and maximum. * *Itallowstosetupthe`m_fValueMinimum`andthe`m_fValueMaximum` *parameterswhichareusedbythe`calculateExplicitScaleAndIncrement` *methodforinitializingthe`Minimum`and`Maximum`propertiesofthe *explicitscalewhenthesamepropertiesofthe`ScaleData`objectare *undefined(thatisempty`uno::Any`objects).
*/ void expandValueRange( double fMinimum, double fMaximum ); void resetValueRange();
/** Sets the maximum allowed number of automatic main increments. @descrThenumberofmainincrementsmaybelimitede.g.bythelength
of the axis and the font size of the axis caption text. */ void setMaximumAutoMainIncrementCount( sal_Int32 nMaximumAutoMainIncrementCount );
/** Sets the time resolution to be used in case it is not set explicitly within the scale
*/ void setAutomaticTimeResolution( sal_Int32 nTimeResolution );
/** Fills the passed scale data and increment data according to the own settings. * *Itperformstheinitializationofthepassedexplicitscaleand *explicitincrementparameters,mainlytheinitializationisachievedby *usingthe`ScaleData`objectasdatasource.Howeverotherparameters *whichaffectthebehaviorofthismethodcanbesetthrough *the`setAutoScalingOptions`andthe`expandValueRange`methods.
*/ void calculateExplicitScaleAndIncrement(
ExplicitScaleData& rExplicitScale,
ExplicitIncrementData& rExplicitIncrement ) const;
private: /** Fills the passed scale data and increment data for category scaling. */ void calculateExplicitIncrementAndScaleForCategory(
ExplicitScaleData& rExplicitScale,
ExplicitIncrementData& rExplicitIncrement, bool bAutoMinimum, bool bAutoMaximum ) const;
/** Fills the passed scale data and increment data for logarithmic scaling. */ void calculateExplicitIncrementAndScaleForLogarithmic(
ExplicitScaleData& rExplicitScale,
ExplicitIncrementData& rExplicitIncrement, bool bAutoMinimum, bool bAutoMaximum ) const;
/** Fills the passed scale data and increment data for linear scaling. */ void calculateExplicitIncrementAndScaleForLinear(
ExplicitScaleData& rExplicitScale,
ExplicitIncrementData& rExplicitIncrement, bool bAutoMinimum, bool bAutoMaximum ) const;
/** Fills the passed scale data and increment data for date-time axis. */ void calculateExplicitIncrementAndScaleForDateTimeAxis(
ExplicitScaleData& rExplicitScale,
ExplicitIncrementData& rExplicitIncrement, bool bAutoMinimum, bool bAutoMaximum ) const;
private:
css::chart2::ScaleData m_aSourceScale;
double m_fValueMinimum; /// Minimum of all source values. double m_fValueMaximum; /// Maximum of all source values.
sal_Int32 m_nMaximumAutoMainIncrementCount; /// Maximum number of automatic main increments. bool m_bExpandBorderToIncrementRhythm; /// true = Expand to main increments. bool m_bExpandIfValuesCloseToBorder; /// true = Expand if values are too close to the borders. bool m_bExpandWideValuesToZero; /// true = Expand wide spread values to zero. bool m_bExpandNarrowValuesTowardZero; /// true = Expand narrow range toward zero (add half of range).
sal_Int32 m_nTimeResolution;// a constant out of css::chart::TimeUnit
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.