KChart

KChartAbstractPieDiagram.h
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#ifndef KCHARTABSTRACTPIEDIAGRAM_H
10#define KCHARTABSTRACTPIEDIAGRAM_H
11
12#include "KChartAbstractPolarDiagram.h"
13
14namespace KChart {
15 class PieAttributes;
16 class ThreeDPieAttributes;
17
18/**
19 * @brief Base class for any diagram type
20 */
21class KCHART_EXPORT AbstractPieDiagram : public AbstractPolarDiagram
22{
23 Q_OBJECT
24
25 Q_DISABLE_COPY( AbstractPieDiagram )
26 KCHART_DECLARE_DERIVED_DIAGRAM( AbstractPieDiagram, PolarCoordinatePlane )
27
28public:
29 explicit AbstractPieDiagram(
30 QWidget* parent = nullptr, PolarCoordinatePlane* plane = nullptr );
31 ~AbstractPieDiagram() override;
32
33 /**
34 * Returns true if both diagrams have the same settings.
35 */
36 bool compare( const AbstractPieDiagram* other ) const;
37
38 /** Set the granularity: the smaller the granularity the more your diagram
39 * segments will show facettes instead of rounded segments.
40 * \param value the granularity value between 0.05 (one twentieth of a degree)
41 * and 36.0 (one tenth of a full circle), other values will be interpreted as 1.0.
42 */
43 void setGranularity( qreal value );
44
45 /** @return the granularity. */
46 qreal granularity() const;
47
48 /** \deprecated Use PolarCoordinatePlane::setStartPosition( qreal degrees ) instead. */
49 void setStartPosition( int degrees );
50 /** \deprecated Use qreal PolarCoordinatePlane::startPosition instead. */
51 int startPosition() const;
52
53 /** If this property is set, and if a pie's TextAttributes have no rotation set, its labels will
54 * automatically be rotated according to the pie's angle.
55 */
56 void setAutoRotateLabels( bool autoRotate );
57 /** \see setAutoRotateLabels( bool autoRotate )
58 */
59 bool autoRotateLabels() const;
60
61 void setPieAttributes( const PieAttributes & a );
62 void setPieAttributes( int column,
63 const PieAttributes & a );
64 void setPieAttributes( const QModelIndex & index,
65 const PieAttributes & a );
66 PieAttributes pieAttributes() const;
67 PieAttributes pieAttributes( int column ) const;
68 PieAttributes pieAttributes( const QModelIndex & index ) const;
69
70 void setThreeDPieAttributes( const ThreeDPieAttributes & a );
71 void setThreeDPieAttributes( int column,
72 const ThreeDPieAttributes & a );
73 void setThreeDPieAttributes( const QModelIndex & index,
74 const ThreeDPieAttributes & a );
75 ThreeDPieAttributes threeDPieAttributes() const;
76 ThreeDPieAttributes threeDPieAttributes( int column ) const;
77 ThreeDPieAttributes threeDPieAttributes( const QModelIndex & index ) const;
78}; // End of class KChartAbstractPieDiagram
79
80}
81
82#endif // KCHARTABSTACTPIEDIAGRAM_H
Base class for any diagram type.
Base class for diagrams based on a polar coordinate system.
A set of attributes controlling the appearance of pie charts.
A set of 3D pie attributes.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.