kchart

KDChartPiePainter.h
1/*
2 KDChart - a multi-platform charting engine
3 */
4
5/****************************************************************************
6 ** Copyright (C) 2001-2003 Klarälvdalens Datakonsult AB. All rights reserved.
7 **
8 ** This file is part of the KDChart library.
9 **
10 ** This file may be distributed and/or modified under the terms of the
11 ** GNU General Public License version 2 as published by the Free Software
12 ** Foundation and appearing in the file LICENSE.GPL included in the
13 ** packaging of this file.
14 **
15 ** Licensees holding valid commercial KDChart licenses may use this file in
16 ** accordance with the KDChart Commercial License Agreement provided with
17 ** the Software.
18 **
19 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21 **
22 ** See http://www.klaralvdalens-datakonsult.se/?page=products for
23 ** information about KDChart Commercial License Agreements.
24 **
25 ** Contact info@klaralvdalens-datakonsult.se if any conditions of this
26 ** licensing are not clear to you.
27 **
28 **********************************************************************/
29#ifndef __KDCHARTPIEPAINTER_H__
30#define __KDCHARTPIEPAINTER_H__
31
32#include <KDChartPainter.h>
33#include <KDChartTable.h>
34
35class KDChartParams;
36
37class KDChartPiePainter : public KDChartPainter
38{
39 friend class KDChartPainter;
40 protected:
42 virtual ~KDChartPiePainter();
43
44 virtual void paintData( TQPainter* painter,
46 bool paint2nd,
47 KDChartDataRegionList* regions = 0 );
48 virtual void drawOnePie( TQPainter* painter,
50 uint dataset, uint pie, uint chart,
51 uint threeDPieHeight,
52 KDChartDataRegionList* regions = 0 );
53 virtual void draw3DEffect( TQPainter* painter, const TQRect& drawPosition,
54 uint dataset, uint pie, uint chart,
55 uint threeDPieHeight,
56 bool explode,
57 TQRegion* region = 0 );
58 void drawStraightEffectSegment( TQPainter* painter, const TQRect& rect,
59 uint dataset, uint pie, uint chart,
60 int threeDHeight, int angle,
61 TQRegion* region = 0 );
62 void drawArcEffectSegment( TQPainter* painter, const TQRect& rect,
63 uint dataset, uint pie, uint chart,
64 int threeDHeight, int startAngle,
65 int endAngle,
66 TQRegion* region = 0 );
67
68 virtual TQString fallbackLegendText( uint dataset ) const;
69 virtual uint numLegendFallbackTexts( KDChartTableDataBase* data ) const;
70
71 uint findPieAt( int angle );
72 uint findLeftPie( uint pie );
73 uint findRightPie( uint pie );
74
75 TQMemArray < int > _startAngles;
76 TQMemArray < int > _angleLens;
77
78 TQRect _position;
79 int _size;
80 int _numValues; // PENDING(kalle) Move to base class
81}
82;
83
84#endif
The collection class used by KD Chart to store data region information.
Bundles the display parameters of a chart.
virtual void drawOnePie(TQPainter *painter, KDChartTableDataBase *data, uint dataset, uint pie, uint chart, uint threeDPieHeight, KDChartDataRegionList *regions=0)
Internal method that draws one of the pies in a pie chart.
void drawStraightEffectSegment(TQPainter *painter, const TQRect &rect, uint dataset, uint pie, uint chart, int threeDHeight, int angle, TQRegion *region=0)
Internal method that draws a segment with a straight 3D effect.
virtual void draw3DEffect(TQPainter *painter, const TQRect &drawPosition, uint dataset, uint pie, uint chart, uint threeDPieHeight, bool explode, TQRegion *region=0)
Internal method that draws the shadow creating the 3D effect of a pie.
virtual TQString fallbackLegendText(uint dataset) const
This method is a specialization that returns a fallback legend text appropriate for pies that do not ...
uint findRightPie(uint pie)
Internal method that finds the pie that is located to the right of the pie specified by pie.
uint findPieAt(int angle)
Internal method that finds the pie that is located at the position specified by angle.
virtual ~KDChartPiePainter()
Destructor.
virtual void paintData(TQPainter *painter, KDChartTableDataBase *data, bool paint2nd, KDChartDataRegionList *regions=0)
Paints the actual data area.
KDChartPiePainter(KDChartParams *params)
Constructor.
uint findLeftPie(uint pie)
Internal method that finds the pie that is located to the left of the pie specified by pie.
void drawArcEffectSegment(TQPainter *painter, const TQRect &rect, uint dataset, uint pie, uint chart, int threeDHeight, int startAngle, int endAngle, TQRegion *region=0)
Internal method that draws a segment with an arc 3D effect.
virtual uint numLegendFallbackTexts(KDChartTableDataBase *data) const
This methods returns the number of elements to be shown in the legend in case fallback texts are used...
KD Chart's build-in table data for an easy way of storing data values.