KChart

KChartStockBarAttributes.cpp
1 /*
2  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #include "KChartStockBarAttributes.h"
21 
22 #define d d_func()
23 
24 using namespace KChart;
25 
26 class Q_DECL_HIDDEN StockBarAttributes::Private {
27 public:
28  Private();
29 
30  qreal candlestickWidth;
31  qreal tickLength;
32 };
33 
34 StockBarAttributes::Private::Private()
35  : candlestickWidth( 0.3 )
36  , tickLength( 0.15 )
37 {
38 }
39 
40 StockBarAttributes::StockBarAttributes()
41  : _d( new Private )
42 {
43 }
44 
45 StockBarAttributes::StockBarAttributes( const StockBarAttributes& r )
46  : _d( new Private( *r.d ) )
47 {
48 }
49 
50 StockBarAttributes &StockBarAttributes::operator= ( const StockBarAttributes& r )
51 {
52  if ( this == &r )
53  return *this;
54 
55  *d = *r.d;
56 
57  return *this;
58 }
59 
60 StockBarAttributes::~StockBarAttributes()
61 {
62  delete _d;
63 }
64 
66 {
67  d->candlestickWidth = width;
68 }
70 {
71  return d->candlestickWidth;
72 }
73 
75 {
76  d->tickLength = length;
77 }
78 
80 {
81  return d->tickLength;
82 }
83 
84 bool StockBarAttributes::operator==( const StockBarAttributes& r ) const
85 {
86  return candlestickWidth() == r.candlestickWidth() &&
87  tickLength() == r.tickLength();
88 }
Attributes to customize the appearance of a column in a stock chart.
void setCandlestickWidth(qreal width)
Sets the width of a candlestick.
Global namespace.
void setTickLength(qreal length)
Sets the tick length of both the open and close marker.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Sep 29 2020 22:42:41 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.