KChart

KChartStockBarAttributes.cpp
1/*
2 * SPDX-FileCopyrightText: 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3 *
4 * This file is part of the KD Chart library.
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#include "KChartStockBarAttributes.h"
10
11#define d d_func()
12
13using namespace KChart;
14
15class Q_DECL_HIDDEN StockBarAttributes::Private {
16public:
17 Private();
18
19 qreal candlestickWidth;
20 qreal tickLength;
21};
22
23StockBarAttributes::Private::Private()
24 : candlestickWidth( 0.3 )
25 , tickLength( 0.15 )
26{
27}
28
29StockBarAttributes::StockBarAttributes()
30 : _d( new Private )
31{
32}
33
34StockBarAttributes::StockBarAttributes( const StockBarAttributes& r )
35 : _d( new Private( *r.d ) )
36{
37}
38
39StockBarAttributes &StockBarAttributes::operator= ( const StockBarAttributes& r )
40{
41 if ( this == &r )
42 return *this;
43
44 *d = *r.d;
45
46 return *this;
47}
48
49StockBarAttributes::~StockBarAttributes()
50{
51 delete _d;
52}
53
55{
56 d->candlestickWidth = width;
57}
59{
60 return d->candlestickWidth;
61}
62
64{
65 d->tickLength = length;
66}
67
69{
70 return d->tickLength;
71}
72
73bool StockBarAttributes::operator==( const StockBarAttributes& r ) const
74{
75 return candlestickWidth() == r.candlestickWidth() &&
76 tickLength() == r.tickLength();
77}
Attributes to customize the appearance of a column in a stock chart.
void setCandlestickWidth(qreal width)
Sets the width of a candlestick.
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-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:57:24 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.