1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "BarPositionHelper.hxx"
21 #include "Linear3DTransformation.hxx"
22 #include "ViewDefines.hxx"
23 #include "CommonConverters.hxx"
24 #include "DateHelper.hxx"
25 #include <com/sun/star/chart/TimeUnit.hpp>
29 using namespace ::com::sun::star
;
30 using namespace ::com::sun::star::chart2
;
32 BarPositionHelper::BarPositionHelper( bool /* bSwapXAndY */ )
33 : CategoryPositionHelper( 1 )
35 AllowShiftXAxisPos(true);
36 AllowShiftZAxisPos(true);
39 BarPositionHelper::BarPositionHelper( const BarPositionHelper
& rSource
)
40 : CategoryPositionHelper( rSource
)
41 , PlottingPositionHelper( rSource
)
45 BarPositionHelper::~BarPositionHelper()
49 PlottingPositionHelper
* BarPositionHelper::clone() const
51 BarPositionHelper
* pRet
= new BarPositionHelper(*this);
55 void BarPositionHelper::updateSeriesCount( double fSeriesCount
)
57 m_fSeriesCount
= fSeriesCount
;
60 double BarPositionHelper::getScaledSlotPos( double fUnscaledLogicX
, double fSeriesNumber
) const
63 fUnscaledLogicX
= DateHelper::RasterizeDateValue( fUnscaledLogicX
, m_aNullDate
, m_nTimeResolution
);
64 double fScaledLogicX(fUnscaledLogicX
);
65 doLogicScaling(&fScaledLogicX
,NULL
,NULL
);
66 fScaledLogicX
= CategoryPositionHelper::getScaledSlotPos( fScaledLogicX
, fSeriesNumber
);
71 void BarPositionHelper::setScaledCategoryWidth( double fScaledCategoryWidth
)
73 m_fScaledCategoryWidth
= fScaledCategoryWidth
;
74 CategoryPositionHelper::setCategoryWidth( m_fScaledCategoryWidth
);
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */