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 .
21 #include "BarPositionHelper.hxx"
22 #include "Linear3DTransformation.hxx"
23 #include "ViewDefines.hxx"
24 #include "CommonConverters.hxx"
25 #include "DateHelper.hxx"
26 #include <com/sun/star/chart/TimeUnit.hpp>
28 //.............................................................................
31 //.............................................................................
32 using namespace ::com::sun::star
;
33 using namespace ::com::sun::star::chart2
;
35 BarPositionHelper::BarPositionHelper( bool /* bSwapXAndY */ )
36 : CategoryPositionHelper( 1 )
38 AllowShiftXAxisPos(true);
39 AllowShiftZAxisPos(true);
42 BarPositionHelper::BarPositionHelper( const BarPositionHelper
& rSource
)
43 : CategoryPositionHelper( rSource
)
44 , PlottingPositionHelper( rSource
)
48 BarPositionHelper::~BarPositionHelper()
52 PlottingPositionHelper
* BarPositionHelper::clone() const
54 BarPositionHelper
* pRet
= new BarPositionHelper(*this);
58 void BarPositionHelper::updateSeriesCount( double fSeriesCount
)
60 m_fSeriesCount
= fSeriesCount
;
63 double BarPositionHelper::getScaledSlotPos( double fUnscaledLogicX
, double fSeriesNumber
) const
66 fUnscaledLogicX
= DateHelper::RasterizeDateValue( fUnscaledLogicX
, m_aNullDate
, m_nTimeResolution
);
67 double fScaledLogicX(fUnscaledLogicX
);
68 doLogicScaling(&fScaledLogicX
,NULL
,NULL
);
69 fScaledLogicX
= CategoryPositionHelper::getScaledSlotPos( fScaledLogicX
, fSeriesNumber
);
74 void BarPositionHelper::setScaledCategoryWidth( double fScaledCategoryWidth
)
76 m_fScaledCategoryWidth
= fScaledCategoryWidth
;
77 CategoryPositionHelper::setCategoryWidth( m_fScaledCategoryWidth
);
79 //.............................................................................
81 //.............................................................................
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */