1
/****************************************************************************
2
** Copyright (C) 2001-2010 Klaralvdalens Datakonsult AB. All rights reserved.
4
** This file is part of the KD Chart library.
6
** Licensees holding valid commercial KD Chart licenses may use this file in
7
** accordance with the KD Chart Commercial License Agreement provided with
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 and version 3 as published by the
13
** Free Software Foundation and appearing in the file LICENSE.GPL included.
15
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18
** Contact info@kdab.com if any conditions of this licensing are not
21
**********************************************************************/
23
#ifndef KDCHART_STOCK_DIAGRAM_P_H
24
#define KDCHART_STOCK_DIAGRAM_P_H
26
#include "KDChartStockDiagram.h"
27
#include "KDChartAbstractCartesianDiagram_p.h"
28
#include "KDChartCartesianDiagramDataCompressor_p.h"
29
#include "KDChartPaintContext.h"
33
class StockDiagram::Private : public AbstractCartesianDiagram::Private
35
friend class StockDiagram;
39
Private( const Private& r );
43
StockDiagram *diagram;
45
QBrush upTrendCandlestickBrush;
46
QBrush downTrendCandlestickBrush;
47
QPen upTrendCandlestickPen;
48
QPen downTrendCandlestickPen;
50
QMap<int, QBrush> upTrendCandlestickBrushes;
51
QMap<int, QBrush> downTrendCandlestickBrushes;
52
QMap<int, QPen> upTrendCandlestickPens;
53
QMap<int, QPen> downTrendCandlestickPens;
56
QMap<int, QPen> lowHighLinePens;
59
void drawOHLCBar( const CartesianDiagramDataCompressor::DataPoint &open,
60
const CartesianDiagramDataCompressor::DataPoint &high,
61
const CartesianDiagramDataCompressor::DataPoint &low,
62
const CartesianDiagramDataCompressor::DataPoint &close,
63
PaintContext *context );
64
void drawHLCBar( const CartesianDiagramDataCompressor::DataPoint &high,
65
const CartesianDiagramDataCompressor::DataPoint &low,
66
const CartesianDiagramDataCompressor::DataPoint &close,
67
PaintContext *context );
68
void drawCandlestick( const CartesianDiagramDataCompressor::DataPoint &open,
69
const CartesianDiagramDataCompressor::DataPoint &high,
70
const CartesianDiagramDataCompressor::DataPoint &low,
71
const CartesianDiagramDataCompressor::DataPoint &close,
72
PaintContext *context );
75
void drawLine( int col, const QPointF &point1, const QPointF &p2, PaintContext *context );
76
QPointF projectPoint( PaintContext *context, const QPointF &point ) const;
77
QRectF projectCandlestick( PaintContext *context, const QPointF &open, const QPointF &close, qreal width ) const;
78
int openValueColumn() const;
79
int highValueColumn() const;
80
int lowValueColumn() const;
81
int closeValueColumn() const;
86
KDCHART_IMPL_DERIVED_DIAGRAM( StockDiagram, AbstractCartesianDiagram, CartesianCoordinatePlane )
90
#endif // KDCHART_STOCK_DIAGRAM_P_H