KChart

KChartRadarDiagram.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 KCHARTRADARDIAGRAM_H
10#define KCHARTRADARDIAGRAM_H
11
12
13#include "KChartPosition.h"
14#include "KChartPolarDiagram.h"
15#include "KChartRadarCoordinatePlane.h"
16
17QT_BEGIN_NAMESPACE
18class QPolygonF;
19QT_END_NAMESPACE
20
21namespace KChart {
22
23/**
24 * @brief RadarDiagram defines a common radar diagram
25 */
26class KCHART_EXPORT RadarDiagram : public AbstractPolarDiagram
27{
28 Q_OBJECT
29
30 Q_DISABLE_COPY( RadarDiagram )
31 KCHART_DECLARE_DERIVED_DIAGRAM( RadarDiagram, RadarCoordinatePlane )
32
33public:
34 explicit RadarDiagram(
35 QWidget* parent = nullptr, RadarCoordinatePlane* plane = nullptr );
36 ~RadarDiagram() override;
37
38 virtual void paint ( PaintContext* paintContext,
39 bool calculateListAndReturnScale,
40 qreal& newZoomX, qreal& newZoomY );
41 /** \reimpl */
42 void resize ( const QSizeF& area ) override;
43
44 /** \reimpl */
45 qreal valueTotals () const override;
46 /** \reimpl */
47 qreal numberOfValuesPerDataset() const override;
48 /** \reimpl */
49 qreal numberOfGridRings() const override;
50
51 /**
52 * if val is true the diagram will mirror the diagram datapoints
53 */
54 void setReverseData( bool val );
55 bool reverseData();
56
57 /**
58 * Creates an exact copy of this diagram.
59 */
60 virtual RadarDiagram * clone() const;
61
62 /**
63 * Close each of the data series by connecting the last point to its
64 * respective start point
65 */
66 void setCloseDatasets( bool closeDatasets );
67 bool closeDatasets() const;
68
69 /**
70 * Fill the areas of the radar chart with there respective color defined
71 * via KChart::DatasetBrushRole. The value defines the alpha of the
72 * color to use. If set to 0.0 (the default) then the radar areas will
73 * not be filled with any color. If set to 1.0 then the areas will be
74 * solid filled and are not transparent.
75 */
76 qreal fillAlpha() const;
77 void setFillAlpha(qreal alphaF);
78
79protected:
80 /** \reimpl */
81 const QPair<QPointF, QPointF> calculateDataBoundaries() const override;
82 void paintEvent ( QPaintEvent* ) override;
83 void resizeEvent ( QResizeEvent* ) override;
84 void paint ( PaintContext* paintContext ) override;
85
86}; // End of class RadarDiagram
87
88}
89
90#endif // KCHARTRADARDIAGRAM_H
Base class for diagrams based on a polar coordinate system.
Stores information about painting diagrams.
RadarDiagram defines a common radar diagram.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:24 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.