LibreOffice Module chart2 (master) 1
|
This class is a container of SeriesPlotter
objects (such as PieChart
instances).
More...
#include <SeriesPlotterContainer.hxx>
Public Member Functions | |
SeriesPlotterContainer (std::vector< std::unique_ptr< VCoordinateSystem > > &rVCooSysList) | |
~SeriesPlotterContainer () | |
void | initializeCooSysAndSeriesPlotter (ChartModel &rModel) |
It is used to set coordinate systems (m_rVCooSysList ), this method is invoked by ChartView::createShapes2D before of ChartView::impl_createDiagramAndContent . More... | |
void | initAxisUsageList (const Date &rNullDate) |
This method is invoked by ChartView::impl_createDiagramAndContent . More... | |
void | doAutoScaling (ChartModel &rModel) |
Perform automatic axis scaling and determine the amount and spacing of increments. More... | |
void | updateScalesAndIncrementsOnAxes () |
After auto-scaling is performed, call this method to set the explicit scaling and increment data to all relevant VAxis objects. More... | |
void | setScalesFromCooSysToPlotter () |
After auto-scaling is performed, call this method to set the explicit scaling data to all the plotters. More... | |
void | setNumberFormatsFromAxes () |
css::drawing::Direction3D | getPreferredAspectRatio () |
std::vector< std::unique_ptr< VSeriesPlotter > > & | getSeriesPlotterList () |
std::vector< std::unique_ptr< VCoordinateSystem > > & | getCooSysList () |
std::vector< LegendEntryProvider * > | getLegendEntryProviderList () |
void | AdaptScaleOfYAxisWithoutAttachedSeries (ChartModel &rModel) |
bool | isCategoryPositionShifted (const css::chart2::ScaleData &rSourceScale, bool bHasComplexCategories) |
Static Public Member Functions | |
static VCoordinateSystem * | getCooSysForPlotter (const std::vector< std::unique_ptr< VCoordinateSystem > > &rVCooSysList, MinimumAndMaximumSupplier *pMinimumAndMaximumSupplier) |
static VCoordinateSystem * | addCooSysToList (std::vector< std::unique_ptr< VCoordinateSystem > > &rVCooSysList, const rtl::Reference< BaseCoordinateSystem > &xCooSys, ChartModel &rChartModel) |
static VCoordinateSystem * | findInCooSysList (const std::vector< std::unique_ptr< VCoordinateSystem > > &rVCooSysList, const rtl::Reference< BaseCoordinateSystem > &xCooSys) |
Private Attributes | |
std::vector< std::unique_ptr< VSeriesPlotter > > | m_aSeriesPlotterList |
A vector of series plotters. More... | |
std::vector< std::unique_ptr< VCoordinateSystem > > & | m_rVCooSysList |
A vector of coordinate systems. More... | |
std::map< rtl::Reference< Axis >, AxisUsage > | m_aAxisUsageList |
A map whose key is a XAxis interface and the related value is an object of AxisUsage type. More... | |
sal_Int32 | m_nMaxAxisIndex |
Max axis index of all dimensions. More... | |
bool | m_bChartTypeUsesShiftedCategoryPositionPerDefault |
bool | m_bForceShiftPosition = false |
sal_Int32 | m_nDefaultDateNumberFormat |
This class is a container of SeriesPlotter
objects (such as PieChart
instances).
It is used for initializing coordinate systems, axes and scales of all series plotters which belongs to the container.
Definition at line 31 of file SeriesPlotterContainer.hxx.
|
explicit |
Definition at line 57 of file SeriesPlotterContainer.cxx.
chart::SeriesPlotterContainer::~SeriesPlotterContainer | ( | ) |
Definition at line 66 of file SeriesPlotterContainer.cxx.
References m_rVCooSysList.
void chart::SeriesPlotterContainer::AdaptScaleOfYAxisWithoutAttachedSeries | ( | ChartModel & | rModel | ) |
Definition at line 552 of file SeriesPlotterContainer.cxx.
References chart::ExplicitScaleData::AxisType, chart::ExplicitIncrementData::BaseValue, chart::ExplicitIncrementData::Distance, chart::DataSeriesHelper::getAttachedAxisIndex(), chart::AxisHelper::getCrossingMainAxis(), if(), chart::AxisHelper::isAxisPositioningEnabled(), m_aAxisUsageList, m_nMaxAxisIndex, chart::ExplicitScaleData::Maximum, chart::ExplicitScaleData::Minimum, chart::ExplicitScaleData::Orientation, chart::ExplicitScaleData::Origin, chart::ExplicitScaleData::Scaling, and chart::ExplicitIncrementData::SubIncrements.
Referenced by doAutoScaling().
|
static |
Definition at line 108 of file SeriesPlotterContainer.cxx.
References chart::VCoordinateSystem::createCoordinateSystem(), chart::ObjectIdentifier::createParticleForCoordinateSystem(), and findInCooSysList().
Referenced by initializeCooSysAndSeriesPlotter().
void chart::SeriesPlotterContainer::doAutoScaling | ( | ChartModel & | rModel | ) |
Perform automatic axis scaling and determine the amount and spacing of increments.
It assumes that the caller has determined the size of the largest axis label text object prior to calling this method.
The new axis scaling data will be stored in the VCoordinateSystem objects. The label alignment direction for each axis will also get determined during this process, and stored in VAxis.
This method is invoked by ChartView::impl_createDiagramAndContent
soon after initAxisUsageList
. It initializes explicit scale and increment objects for all coordinate systems in m_rVCooSysList
. This action is achieved by iterating on the m_aAxisUsageList
container, and performing 3 steps: 1- call VCoordinateSystem::prepareAutomaticAxisScaling
for setting scaling parameters of the aAutoScaling
member (a ScaleAutomatism
object) for the current AxisUsage
instance (see VCoordinateSystem::prepareAutomaticAxisScaling
); 2- calculate the explicit scale and increment objects (see ScaleAutomatism::calculateExplicitScaleAndIncrement); 3- set the explicit scale and increment objects for each coordinate system.
Definition at line 503 of file SeriesPlotterContainer.cxx.
References AdaptScaleOfYAxisWithoutAttachedSeries(), m_aAxisUsageList, m_aSeriesPlotterList, and m_nMaxAxisIndex.
|
static |
Definition at line 82 of file SeriesPlotterContainer.cxx.
Referenced by addCooSysToList(), and chart::ChartView::getExplicitValuesForAxis().
|
static |
Definition at line 94 of file SeriesPlotterContainer.cxx.
Referenced by chart::ChartView::impl_createDiagramAndContent(), setNumberFormatsFromAxes(), and setScalesFromCooSysToPlotter().
|
inline |
Definition at line 113 of file SeriesPlotterContainer.hxx.
References m_rVCooSysList.
std::vector< LegendEntryProvider * > chart::SeriesPlotterContainer::getLegendEntryProviderList | ( | ) |
Definition at line 73 of file SeriesPlotterContainer.cxx.
References m_aSeriesPlotterList.
drawing::Direction3D chart::SeriesPlotterContainer::getPreferredAspectRatio | ( | ) |
Definition at line 703 of file SeriesPlotterContainer.cxx.
References m_aSeriesPlotterList.
|
inline |
Definition at line 109 of file SeriesPlotterContainer.hxx.
References m_aSeriesPlotterList.
void chart::SeriesPlotterContainer::initAxisUsageList | ( | const Date & | rNullDate | ) |
This method is invoked by ChartView::impl_createDiagramAndContent
.
It iterates on every axis of every coordinate systems, and if the axis is not yet present in m_aAxisUsageList
it creates a new AxisUsage
object and initialize its aAutoScaling
member to the ScaleData
object of the current axis.
Definition at line 356 of file SeriesPlotterContainer.cxx.
References chart::AxisUsage::addCoordinateSystem(), chart::AxisHelper::checkDateAxis(), chart::AxisHelper::getChartTypeByIndex(), chart::ExplicitCategoriesProvider::hasComplexCategories(), isCategoryPositionShifted(), chart::ChartTypeHelper::isSupportingComplexCategory(), chart::ChartTypeHelper::isSupportingDateAxis(), m_aAxisUsageList, m_nMaxAxisIndex, m_rVCooSysList, and nDimCount.
void chart::SeriesPlotterContainer::initializeCooSysAndSeriesPlotter | ( | ChartModel & | rModel | ) |
It is used to set coordinate systems (m_rVCooSysList
), this method is invoked by ChartView::createShapes2D
before of ChartView::impl_createDiagramAndContent
.
Coordinate systems are retrieved through the XCoordinateSystemContainer
interface implemented by a diagram object which is provided by the ChartModel
object passed to the method (rChartModel.getFirstDiagram()
).
It is used for creating series plotters and appending them to m_aSeriesPlotterList
. The created series plotters are initialized through data (number formats supplier, color scheme, data series), extracted from the chart model or the diagram objects. An exception is the explicit category provider that is retrieved through the VCoordinateSystem
object used by the series plotter.
It sets the minimum-maximum supplier for a coordinate system: this supplier is the series plotter itself which utilizes the given coordinate system. In fact VSeriesPlotter
has MinimumMaximumSupplier
as one of its base classes. Hence, for instance, a PieChart
, which is a series plotter, is a MinimumMaximumSupplier
, too.
Definition at line 131 of file SeriesPlotterContainer.cxx.
References addCooSysToList(), chart::VCoordinateSystem::addMinimumAndMaximumSupplier(), chart::VSeriesPlotter::addSeries(), CHART2_SERVICE_NAME_CHARTTYPE_PIE, CHART_UNONAME_SORT_BY_XVALUES, chart::ObjectIdentifier::createParticleForSeries(), chart::VSeriesPlotter::createSeriesPlotter(), DBG_UNHANDLED_EXCEPTION, chart::Excluding, chart::DiagramHelper::getDateNumberFormat(), chart::VCoordinateSystem::getExplicitCategoriesProvider(), chart::ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection(), chart::ChartTypeHelper::isSupportingSecondaryAxis(), m_aSeriesPlotterList, m_bChartTypeUsesShiftedCategoryPositionPerDefault, m_bForceShiftPosition, m_nDefaultDateNumberFormat, m_rVCooSysList, chart::MAIN_AXIS_INDEX, chart::PROP_PIECHARTTYPE_3DRELATIVEHEIGHT, chart::VSeriesPlotter::setColorScheme(), chart::VSeriesPlotter::setExplicitCategoriesProvider(), chart::VSeriesPlotter::setNumberFormatsSupplier(), chart::ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault(), and TOOLS_WARN_EXCEPTION.
bool chart::SeriesPlotterContainer::isCategoryPositionShifted | ( | const css::chart2::ScaleData & | rSourceScale, |
bool | bHasComplexCategories | ||
) |
Definition at line 340 of file SeriesPlotterContainer.cxx.
References m_bChartTypeUsesShiftedCategoryPositionPerDefault, and m_bForceShiftPosition.
Referenced by initAxisUsageList().
void chart::SeriesPlotterContainer::setNumberFormatsFromAxes | ( | ) |
Definition at line 446 of file SeriesPlotterContainer.cxx.
References CHART_UNONAME_NUMFMT, getCooSysForPlotter(), chart::VCoordinateSystem::getModel(), m_aSeriesPlotterList, m_nDefaultDateNumberFormat, m_rVCooSysList, chart::AxesNumberFormats::setFormat(), and TOOLS_WARN_EXCEPTION.
void chart::SeriesPlotterContainer::setScalesFromCooSysToPlotter | ( | ) |
After auto-scaling is performed, call this method to set the explicit scaling data to all the plotters.
Definition at line 426 of file SeriesPlotterContainer.cxx.
References chart::VSeriesPlotter::addSecondaryValueScale(), getCooSysForPlotter(), chart::VCoordinateSystem::getExplicitScale(), chart::VCoordinateSystem::getExplicitScales(), chart::VCoordinateSystem::getMaximumAxisIndexByDimension(), chart::VCoordinateSystem::getPropertySwapXAndYAxis(), m_aSeriesPlotterList, m_rVCooSysList, and chart::PlotterBase::setScales().
void chart::SeriesPlotterContainer::updateScalesAndIncrementsOnAxes | ( | ) |
After auto-scaling is performed, call this method to set the explicit scaling and increment data to all relevant VAxis objects.
Definition at line 497 of file SeriesPlotterContainer.cxx.
References m_rVCooSysList.
|
private |
A map whose key is a XAxis
interface and the related value is an object of AxisUsage
type.
Definition at line 143 of file SeriesPlotterContainer.hxx.
Referenced by AdaptScaleOfYAxisWithoutAttachedSeries(), doAutoScaling(), and initAxisUsageList().
|
private |
A vector of series plotters.
Definition at line 134 of file SeriesPlotterContainer.hxx.
Referenced by doAutoScaling(), getLegendEntryProviderList(), getPreferredAspectRatio(), getSeriesPlotterList(), initializeCooSysAndSeriesPlotter(), setNumberFormatsFromAxes(), and setScalesFromCooSysToPlotter().
|
private |
Definition at line 153 of file SeriesPlotterContainer.hxx.
Referenced by initializeCooSysAndSeriesPlotter(), and isCategoryPositionShifted().
|
private |
Definition at line 154 of file SeriesPlotterContainer.hxx.
Referenced by initializeCooSysAndSeriesPlotter(), and isCategoryPositionShifted().
|
private |
Definition at line 155 of file SeriesPlotterContainer.hxx.
Referenced by initializeCooSysAndSeriesPlotter(), and setNumberFormatsFromAxes().
|
private |
Max axis index of all dimensions.
Currently this can be either 0 or 1 since we only support primary and secondary axes per dimension. The value of 0 means all dimensions have only primary axis, while 1 means at least one dimension has a secondary axis.
Definition at line 151 of file SeriesPlotterContainer.hxx.
Referenced by AdaptScaleOfYAxisWithoutAttachedSeries(), doAutoScaling(), and initAxisUsageList().
|
private |
A vector of coordinate systems.
Definition at line 138 of file SeriesPlotterContainer.hxx.
Referenced by getCooSysList(), initAxisUsageList(), initializeCooSysAndSeriesPlotter(), setNumberFormatsFromAxes(), setScalesFromCooSysToPlotter(), updateScalesAndIncrementsOnAxes(), and ~SeriesPlotterContainer().