LibreOffice Module chart2 (master) 1
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
chart::BarChart Class Reference

#include <BarChart.hxx>

Inheritance diagram for chart::BarChart:
[legend]
Collaboration diagram for chart::BarChart:
[legend]

Classes

struct  FormerBarPoint
 

Public Member Functions

 BarChart ()=delete
 
 BarChart (const rtl::Reference< ::chart::ChartType > &xChartTypeModel, sal_Int32 nDimensionCount)
 
virtual ~BarChart () override
 
virtual void createShapes () override
 
virtual void addSeries (std::unique_ptr< VDataSeries > pSeries, sal_Int32 zSlot, sal_Int32 xSlot, sal_Int32 ySlot) override
 A new series can be positioned relative to other series in a chart. More...
 
virtual css::drawing::Direction3D getPreferredDiagramAspectRatio () const override
 a value <= 0 for a directions means that this direction can be stretched arbitrary More...
 
- Public Member Functions inherited from chart::VSeriesPlotter
 VSeriesPlotter ()=delete
 
virtual ~VSeriesPlotter () override
 
virtual void addSeries (std::unique_ptr< VDataSeries > pSeries, sal_Int32 zSlot, sal_Int32 xSlot, sal_Int32 ySlot)
 A new series can be positioned relative to other series in a chart. More...
 
virtual css::drawing::Direction3D getPreferredDiagramAspectRatio () const
 a value <= 0 for a directions means that this direction can be stretched arbitrary More...
 
void addSecondaryValueScale (const ExplicitScaleData &rScale, sal_Int32 nAxisIndex)
 this enables you to handle series on the same x axis with different y axis the property AttachedAxisIndex at a dataseries indicates which value scale is to use (0==AttachedAxisIndex or a not set AttachedAxisIndex property indicates that this series should be scaled at the main y-axis; 1==AttachedAxisIndex indicates that the series should be scaled at the first secondary axis if there is any otherwise at the main y axis and so on. More...
 
virtual double getMinimumX () override
 
virtual double getMaximumX () override
 
virtual double getMinimumYInRange (double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex) override
 
virtual double getMaximumYInRange (double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex) override
 
virtual double getMinimumZ () override
 
virtual double getMaximumZ () override
 
virtual bool isExpandBorderToIncrementRhythm (sal_Int32 nDimensionIndex) override
 
virtual bool isExpandIfValuesCloseToBorder (sal_Int32 nDimensionIndex) override
 
virtual bool isExpandWideValuesToZero (sal_Int32 nDimensionIndex) override
 
virtual bool isExpandNarrowValuesTowardZero (sal_Int32 nDimensionIndex) override
 
virtual bool isSeparateStackingForDifferentSigns (sal_Int32 nDimensionIndex) override
 
virtual tools::Long calculateTimeResolutionOnXAxis () override
 
virtual void setTimeResolutionOnXAxis (tools::Long nTimeResolution, const Date &rNullDate) override
 
void getMinimumAndMaximumX (double &rfMinimum, double &rfMaximum) const
 
void getMinimumAndMaximumYInContinuousXRange (double &rfMinY, double &rfMaxY, double fMinX, double fMaxX, sal_Int32 nAxisIndex) const
 
virtual std::vector< ViewLegendEntrycreateLegendEntries (const css::awt::Size &rEntryKeyAspectRatio, css::chart2::LegendPosition eLegendPosition, const css::uno::Reference< css::beans::XPropertySet > &xTextProperties, const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::uno::Reference< css::uno::XComponentContext > &xContext, ChartModel &rModel) override
 
virtual LegendSymbolStyle getLegendSymbolStyle ()
 
virtual css::awt::Size getPreferredLegendKeyAspectRatio () override
 
virtual css::uno::Any getExplicitSymbol (const VDataSeries &rSeries, sal_Int32 nPointIndex)
 
rtl::Reference< SvxShapeGroupcreateLegendSymbolForSeries (const css::awt::Size &rEntryKeyAspectRatio, const VDataSeries &rSeries, const rtl::Reference< SvxShapeGroupAnyD > &xTarget)
 
rtl::Reference< SvxShapeGroupcreateLegendSymbolForPoint (const css::awt::Size &rEntryKeyAspectRatio, const VDataSeries &rSeries, sal_Int32 nPointIndex, const rtl::Reference< SvxShapeGroupAnyD > &xTarget)
 
std::vector< ViewLegendEntrycreateLegendEntriesForSeries (const css::awt::Size &rEntryKeyAspectRatio, const VDataSeries &rSeries, const css::uno::Reference< css::beans::XPropertySet > &xTextProperties, const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::uno::Reference< css::uno::XComponentContext > &xContext)
 
std::vector< ViewLegendSymbolcreateSymbols (const css::awt::Size &rEntryKeyAspectRatio, const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::uno::Reference< css::uno::XComponentContext > &xContext)
 
std::vector< ViewLegendSymbolcreateSymbolsForSeries (const css::awt::Size &rEntryKeyAspectRatio, const VDataSeries &rSeries, const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::uno::Reference< css::uno::XComponentContext > &xContext)
 
std::vector< VDataSeries * > getAllSeries ()
 
std::vector< VDataSeries const * > getAllSeries () const
 
sal_Int32 getPointCount () const
 
void setNumberFormatsSupplier (const css::uno::Reference< css::util::XNumberFormatsSupplier > &xNumFmtSupplier)
 
void setColorScheme (const css::uno::Reference< css::chart2::XColorScheme > &xColorScheme)
 
void setExplicitCategoriesProvider (ExplicitCategoriesProvider *pExplicitCategoriesProvider)
 
ExplicitCategoriesProvidergetExplicitCategoriesProvider ()
 
css::uno::Sequence< OUString > getSeriesNames () const
 
css::uno::Sequence< OUString > getAllSeriesNames () const
 
void setPageReferenceSize (const css::awt::Size &rPageRefSize)
 
void setCoordinateSystemResolution (const css::uno::Sequence< sal_Int32 > &rCoordinateSystemResolution)
 
bool PointsWereSkipped () const
 
void setPieLabelsAllowToMove (bool bIsPieOrDonut)
 
void setAvailableOuterRect (const basegfx::B2IRectangle &aAvailableOuterRect)
 
double getTransformedDepth () const
 
void releaseShapes ()
 
virtual void rearrangeLabelToAvoidOverlapIfRequested (const css::awt::Size &rPageSize)
 
bool WantToPlotInFrontOfAxisLine ()
 
virtual bool shouldSnapRectToUsedArea ()
 
OUString getLabelTextForValue (VDataSeries const &rDataSeries, sal_Int32 nPointIndex, double fValue, bool bAsPercentage)
 This method returns a text string representation of the passed numeric value by exploiting a NumberFormatterWrapper object. More...
 
- Public Member Functions inherited from chart::PlotterBase
 PlotterBase (sal_Int32 nDimension)
 
virtual ~PlotterBase ()
 
virtual void initPlotter (const rtl::Reference< SvxShapeGroupAnyD > &xLogicTarget, const rtl::Reference< SvxShapeGroupAnyD > &xFinalTarget, const OUString &rCID)
 
virtual void setScales (std::vector< ExplicitScaleData > &&rScales, bool bSwapXAndYAxis)
 
virtual void setTransformationSceneToScreen (const css::drawing::HomogenMatrix &rMatrix)
 
virtual void createShapes ()=0
 
virtual double getMinimumX ()=0
 
virtual double getMaximumX ()=0
 
virtual double getMinimumYInRange (double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex)=0
 
virtual double getMaximumYInRange (double fMinimumX, double fMaximumX, sal_Int32 nAxisIndex)=0
 
virtual double getMinimumZ ()=0
 
virtual double getMaximumZ ()=0
 
virtual bool isExpandBorderToIncrementRhythm (sal_Int32 nDimensionIndex)=0
 
virtual bool isExpandIfValuesCloseToBorder (sal_Int32 nDimensionIndex)=0
 
virtual bool isExpandWideValuesToZero (sal_Int32 nDimensionIndex)=0
 
virtual bool isExpandNarrowValuesTowardZero (sal_Int32 nDimensionIndex)=0
 
virtual bool isSeparateStackingForDifferentSigns (sal_Int32 nDimensionIndex)=0
 
virtual tools::Long calculateTimeResolutionOnXAxis ()=0
 
virtual void setTimeResolutionOnXAxis (tools::Long nTimeResolution, const Date &rNullDate)=0
 
virtual css::awt::Size getPreferredLegendKeyAspectRatio ()=0
 
virtual std::vector< ViewLegendEntrycreateLegendEntries (const css::awt::Size &rEntryKeyAspectRatio, css::chart2::LegendPosition eLegendPosition, const css::uno::Reference< css::beans::XPropertySet > &xTextProperties, const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::uno::Reference< css::uno::XComponentContext > &xContext, ChartModel &rModel)=0
 

Private Member Functions

css::awt::Point getLabelScreenPositionAndAlignment (LabelAlignment &rAlignment, sal_Int32 nLabelPlacement, double fScaledX, double fScaledLowerYValue, double fScaledUpperYValue, double fScaledZ, double fScaledLowerBarDepth, double fScaledUpperBarDepth, double fBaseValue, BarPositionHelper const *pPosHelper) const
 
virtual PlottingPositionHelpergetPlottingPositionHelper (sal_Int32 nAxisIndex) const override
 
void adaptOverlapAndGapwidthForGroupBarsPerAxis ()
 
void doZSlot (bool &bDrawConnectionLines, bool &bDrawConnectionLinesInited, const std::vector< VDataSeriesGroup > &rZSlot, sal_Int32 nZ, sal_Int32 nPointIndex, sal_Int32 nStartIndex, const rtl::Reference< SvxShapeGroupAnyD > &xSeriesTarget, const rtl::Reference< SvxShapeGroupAnyD > &xRegressionCurveTarget, const rtl::Reference< SvxShapeGroupAnyD > &xRegressionCurveEquationTarget, const rtl::Reference< SvxShapeGroupAnyD > &xTextTarget, std::unordered_set< rtl::Reference< SvxShape > > &aShapeSet, std::map< VDataSeries *, FormerBarPoint > &aSeriesFormerPointMap, std::map< sal_Int32, double > &aLogicYSumMap)
 
void doXSlot (const VDataSeriesGroup &rXSlot, bool &bDrawConnectionLines, bool &bDrawConnectionLinesInited, sal_Int32 nZ, sal_Int32 nPointIndex, sal_Int32 nStartIndex, const rtl::Reference< SvxShapeGroupAnyD > &xSeriesTarget, const rtl::Reference< SvxShapeGroupAnyD > &xRegressionCurveTarget, const rtl::Reference< SvxShapeGroupAnyD > &xRegressionCurveEquationTarget, const rtl::Reference< SvxShapeGroupAnyD > &xTextTarget, std::unordered_set< rtl::Reference< SvxShape > > &aShapeSet, std::map< VDataSeries *, FormerBarPoint > &aSeriesFormerPointMap, std::map< sal_Int32, double > &aLogicYSumMap, double fLogicBaseWidth, double fSlotX, BarPositionHelper *const pPosHelper, double fLogicPositiveYSum, double fLogicNegativeYSum, sal_Int32 nAttachedAxisIndex)
 

Static Private Member Functions

static rtl::Reference< SvxShapecreateDataPoint3D_Bar (const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::drawing::Position3D &rPosition, const css::drawing::Direction3D &rSize, double fTopHeight, sal_Int32 nRotateZAngleHundredthDegree, const css::uno::Reference< css::beans::XPropertySet > &xObjectProperties, sal_Int32 nGeometry3D)
 

Private Attributes

std::unique_ptr< BarPositionHelperm_pMainPosHelper
 
css::uno::Sequence< sal_Int32 > m_aOverlapSequence
 
css::uno::Sequence< sal_Int32 > m_aGapwidthSequence
 

Additional Inherited Members

- Static Public Member Functions inherited from chart::VSeriesPlotter
static VSeriesPlottercreateSeriesPlotter (const rtl::Reference< ::chart::ChartType > &xChartTypeModel, sal_Int32 nDimensionCount, bool bExcludingPositioning)
 
- Static Public Member Functions inherited from chart::PlotterBase
static bool isValidPosition (const css::drawing::Position3D &rPos)
 
- Protected Member Functions inherited from chart::VSeriesPlotter
 VSeriesPlotter (rtl::Reference< ::chart::ChartType > xChartTypeModel, sal_Int32 nDimensionCount, bool bCategoryXAxis=true)
 
rtl::Reference< SvxShapeGroupAnyDgetSeriesGroupShape (VDataSeries *pDataSeries, const rtl::Reference< SvxShapeGroupAnyD > &xTarget)
 
rtl::Reference< SvxShapeGroupAnyDgetSeriesGroupShapeFrontChild (VDataSeries *pDataSeries, const rtl::Reference< SvxShapeGroupAnyD > &xTarget)
 
rtl::Reference< SvxShapeGroupAnyDgetSeriesGroupShapeBackChild (VDataSeries *pDataSeries, const rtl::Reference< SvxShapeGroupAnyD > &xTarget)
 
rtl::Reference< SvxShapeGroupAnyDgetErrorBarsGroupShape (VDataSeries &rDataSeries, const rtl::Reference< SvxShapeGroupAnyD > &xTarget, bool bYError)
 
rtl::Reference< SvxShapeTextcreateDataLabel (const rtl::Reference< SvxShapeGroupAnyD > &xTarget, VDataSeries &rDataSeries, sal_Int32 nPointIndex, double fValue, double fSumValue, const css::awt::Point &rScreenPosition2D, LabelAlignment eAlignment, sal_Int32 nOffset=0, sal_Int32 nTextWidth=0)
 This method creates a text shape for a label related to a data point and append it to the root text shape group (xTarget). More...
 
void createErrorBar (const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const css::drawing::Position3D &rPos, const css::uno::Reference< css::beans::XPropertySet > &xErrorBarProperties, const VDataSeries &rVDataSeries, sal_Int32 nIndex, bool bVertical, const double *pfScaledLogicX)
 creates two T-shaped error bars in both directions (up/down or left/right depending on the bVertical parameter) More...
 
void createErrorRectangle (const css::drawing::Position3D &rUnscaledLogicPosition, VDataSeries &rVDataSeries, sal_Int32 nIndex, const rtl::Reference< SvxShapeGroupAnyD > &rTarget, bool bUseXErrorData, bool bUseYErrorData)
 
void createErrorBar_X (const css::drawing::Position3D &rUnscaledLogicPosition, VDataSeries &rVDataSeries, sal_Int32 nPointIndex, const rtl::Reference< SvxShapeGroupAnyD > &xTarget)
 
void createErrorBar_Y (const css::drawing::Position3D &rUnscaledLogicPosition, VDataSeries &rVDataSeries, sal_Int32 nPointIndex, const rtl::Reference< SvxShapeGroupAnyD > &xTarget, double const *pfScaledLogicX)
 
void createRegressionCurvesShapes (VDataSeries const &rVDataSeries, const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const rtl::Reference< SvxShapeGroupAnyD > &xEquationTarget, bool bMaySkipPointsInRegressionCalculation)
 
void createRegressionCurveEquationShapes (const OUString &rEquationCID, const css::uno::Reference< css::beans::XPropertySet > &xEquationProperties, const rtl::Reference< SvxShapeGroupAnyD > &xEquationTarget, const css::uno::Reference< css::chart2::XRegressionCurveCalculator > &xRegressionCurveCalculator, css::awt::Point aDefaultPos)
 
virtual PlottingPositionHelpergetPlottingPositionHelper (sal_Int32 nAxisIndex) const
 
VDataSeriesgetFirstSeries () const
 
OUString getCategoryName (sal_Int32 nPointIndex) const
 
- Protected Member Functions inherited from chart::PlotterBase
rtl::Reference< SvxShapeGroupAnyDcreateGroupShape (const rtl::Reference< SvxShapeGroupAnyD > &xTarget, const OUString &rName=OUString())
 
- Protected Member Functions inherited from chart::MinimumAndMaximumSupplier
 ~MinimumAndMaximumSupplier ()
 
- Protected Member Functions inherited from chart::LegendEntryProvider
 ~LegendEntryProvider ()
 
- Static Protected Member Functions inherited from chart::VSeriesPlotter
static rtl::Reference< SvxShapeGroupgetLabelsGroupShape (VDataSeries &rDataSeries, const rtl::Reference< SvxShapeGroupAnyD > &xTarget)
 This method creates a 2D group shape for containing all text shapes needed for this series; the group is added to the text target;. More...
 
static void addErrorBorder (const css::drawing::Position3D &rPos0, const css::drawing::Position3D &rPos1, const rtl::Reference< SvxShapeGroupAnyD > &rTarget, const css::uno::Reference< css::beans::XPropertySet > &rErrorBorderProp)
 
- Protected Attributes inherited from chart::VSeriesPlotter
PlottingPositionHelperm_pMainPosHelper
 
rtl::Reference< ::chart::ChartTypem_xChartTypeModel
 
std::vector< std::vector< VDataSeriesGroup > > m_aZSlots
 
bool m_bCategoryXAxis
 
tools::Long m_nTimeResolution
 
Date m_aNullDate
 
std::unique_ptr< NumberFormatterWrapperm_apNumberFormatterWrapper
 
css::uno::Reference< css::chart2::XColorScheme > m_xColorScheme
 
ExplicitCategoriesProviderm_pExplicitCategoriesProvider
 
css::uno::Sequence< sal_Int32 > m_aCoordinateSystemResolution
 
bool m_bPointsWereSkipped
 
bool m_bPieLabelsAllowToMove
 
basegfx::B2IRectangle m_aAvailableOuterRect
 
css::awt::Size m_aPageReferenceSize
 
- Protected Attributes inherited from chart::PlotterBase
rtl::Reference< SvxShapeGroupAnyDm_xLogicTarget
 
rtl::Reference< SvxShapeGroupAnyDm_xFinalTarget
 
OUString m_aCID
 
const sal_Int32 m_nDimension
 
PlottingPositionHelperm_pPosHelper
 

Detailed Description

Definition at line 29 of file BarChart.hxx.

Constructor & Destructor Documentation

◆ BarChart() [1/2]

chart::BarChart::BarChart ( )
delete

◆ BarChart() [2/2]

chart::BarChart::BarChart ( const rtl::Reference< ::chart::ChartType > &  xChartTypeModel,
sal_Int32  nDimensionCount 
)

◆ ~BarChart()

chart::BarChart::~BarChart ( )
overridevirtual

Definition at line 68 of file BarChart.cxx.

Member Function Documentation

◆ adaptOverlapAndGapwidthForGroupBarsPerAxis()

void chart::BarChart::adaptOverlapAndGapwidthForGroupBarsPerAxis ( )
private

◆ addSeries()

void chart::BarChart::addSeries ( std::unique_ptr< VDataSeries pSeries,
sal_Int32  zSlot,
sal_Int32  xSlot,
sal_Int32  ySlot 
)
overridevirtual

A new series can be positioned relative to other series in a chart.

This positioning has two dimensions. First a series can be placed next to each other on the category axis. This position is indicated by xSlot. Second a series can be stacked on top of another. This position is indicated by ySlot. The positions are counted from 0 on. xSlot < 0 : append the series to already existing x series xSlot > occupied : append the series to already existing x series

If the xSlot is already occupied the given ySlot decides what should happen: ySlot < -1 : move all existing series in the xSlot to next slot ySlot == -1 : stack on top at given x position ySlot == already occupied : insert at given y and x position ySlot > occupied : stack on top at given x position

Reimplemented from chart::VSeriesPlotter.

Definition at line 363 of file BarChart.cxx.

◆ createDataPoint3D_Bar()

rtl::Reference< SvxShape > chart::BarChart::createDataPoint3D_Bar ( const rtl::Reference< SvxShapeGroupAnyD > &  xTarget,
const css::drawing::Position3D &  rPosition,
const css::drawing::Direction3D &  rSize,
double  fTopHeight,
sal_Int32  nRotateZAngleHundredthDegree,
const css::uno::Reference< css::beans::XPropertySet > &  xObjectProperties,
sal_Int32  nGeometry3D 
)
staticprivate

Definition at line 294 of file BarChart.cxx.

References TOOLS_WARN_EXCEPTION, and xTarget.

◆ createShapes()

void chart::BarChart::createShapes ( )
overridevirtual

◆ doXSlot()

void chart::BarChart::doXSlot ( const VDataSeriesGroup rXSlot,
bool &  bDrawConnectionLines,
bool &  bDrawConnectionLinesInited,
sal_Int32  nZ,
sal_Int32  nPointIndex,
sal_Int32  nStartIndex,
const rtl::Reference< SvxShapeGroupAnyD > &  xSeriesTarget,
const rtl::Reference< SvxShapeGroupAnyD > &  xRegressionCurveTarget,
const rtl::Reference< SvxShapeGroupAnyD > &  xRegressionCurveEquationTarget,
const rtl::Reference< SvxShapeGroupAnyD > &  xTextTarget,
std::unordered_set< rtl::Reference< SvxShape > > &  aShapeSet,
std::map< VDataSeries *, FormerBarPoint > &  aSeriesFormerPointMap,
std::map< sal_Int32, double > &  aLogicYSumMap,
double  fLogicBaseWidth,
double  fSlotX,
BarPositionHelper *const  pPosHelper,
double  fLogicPositiveYSum,
double  fLogicNegativeYSum,
sal_Int32  nAttachedAxisIndex 
)
private

◆ doZSlot()

void chart::BarChart::doZSlot ( bool &  bDrawConnectionLines,
bool &  bDrawConnectionLinesInited,
const std::vector< VDataSeriesGroup > &  rZSlot,
sal_Int32  nZ,
sal_Int32  nPointIndex,
sal_Int32  nStartIndex,
const rtl::Reference< SvxShapeGroupAnyD > &  xSeriesTarget,
const rtl::Reference< SvxShapeGroupAnyD > &  xRegressionCurveTarget,
const rtl::Reference< SvxShapeGroupAnyD > &  xRegressionCurveEquationTarget,
const rtl::Reference< SvxShapeGroupAnyD > &  xTextTarget,
std::unordered_set< rtl::Reference< SvxShape > > &  aShapeSet,
std::map< VDataSeries *, FormerBarPoint > &  aSeriesFormerPointMap,
std::map< sal_Int32, double > &  aLogicYSumMap 
)
private

◆ getLabelScreenPositionAndAlignment()

awt::Point chart::BarChart::getLabelScreenPositionAndAlignment ( LabelAlignment rAlignment,
sal_Int32  nLabelPlacement,
double  fScaledX,
double  fScaledLowerYValue,
double  fScaledUpperYValue,
double  fScaledZ,
double  fScaledLowerBarDepth,
double  fScaledUpperBarDepth,
double  fBaseValue,
BarPositionHelper const *  pPosHelper 
) const
private

◆ getPlottingPositionHelper()

PlottingPositionHelper & chart::BarChart::getPlottingPositionHelper ( sal_Int32  nAxisIndex) const
overrideprivatevirtual

◆ getPreferredDiagramAspectRatio()

drawing::Direction3D chart::BarChart::getPreferredDiagramAspectRatio ( ) const
overridevirtual

a value <= 0 for a directions means that this direction can be stretched arbitrary

Reimplemented from chart::VSeriesPlotter.

Definition at line 86 of file BarChart.cxx.

References chart::PlottingPositionHelper::getScaledLogicWidth(), chart::CategoryPositionHelper::getScaledSlotWidth(), and chart::MAIN_AXIS_INDEX.

Member Data Documentation

◆ m_aGapwidthSequence

css::uno::Sequence< sal_Int32 > chart::BarChart::m_aGapwidthSequence
private

Definition at line 114 of file BarChart.hxx.

◆ m_aOverlapSequence

css::uno::Sequence< sal_Int32 > chart::BarChart::m_aOverlapSequence
private

Definition at line 113 of file BarChart.hxx.

◆ m_pMainPosHelper

std::unique_ptr<BarPositionHelper> chart::BarChart::m_pMainPosHelper
private

Definition at line 112 of file BarChart.hxx.


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