KChart

KChartLineAttributes.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 KCHARTLINEATTRIBUTES_H
10#define KCHARTLINEATTRIBUTES_H
11
12#include <QMetaType>
13#include "KChartGlobal.h"
14
15namespace KChart {
16
17/**
18 * @brief Set of attributes for changing the appearance of line charts
19 */
20class KCHART_EXPORT LineAttributes
21{
22public:
23 /**
24 \brief MissingValuesPolicy specifies how a missing value will be shown in a line diagram.
25
26 Missing value is assumed if the data cell contains a QVariant that can not be
27 interpreted as a qreal, or if the data cell is hidden while its dataset is not hidden.
28
29 \li \c MissingValuesAreBridged the default: No markers will be shown for missing values
30 but the line will be bridged if there is at least one valid cell before and after
31 the missing value(s), otherwise the segment will be hidden.
32 \li \c MissingValuesHideSegments Line segments starting with a missing value will
33 not be shown, and no markers will be shown for missing values, so this will look like
34 a piece of the line is missing.
35 \li \c MissingValuesShownAsZero Missing value(s) will be treated like normal zero values,
36 and markers will shown for them too, so there will be no visible difference between a
37 zero value and a missing value.
38 \li \c MissingValuesPolicyIgnored (internal value, do not use)
39
40 */
42 MissingValuesAreBridged,
43 MissingValuesHideSegments,
44 MissingValuesShownAsZero,
45 MissingValuesPolicyIgnored };
46
49 LineAttributes &operator= ( const LineAttributes& );
50
52
53 /* line chart and area chart - all types */
54 void setMissingValuesPolicy( MissingValuesPolicy policy );
55 MissingValuesPolicy missingValuesPolicy() const;
56
57 /* area chart - all types */
58 /**
59 * Sets the lower or upper (depending on the displayed value being positive or
60 * negative, resp.) bounding line (i.e., the dataset with the line data). The area
61 * is then drawn between this line and the line of the specified dataset.
62 * Pass -1 to draw the area between this line and the zero line.
63 */
64 void setAreaBoundingDataset( int dataset );
65 int areaBoundingDataset() const;
66
67 /**
68 * Determines if lines are to be drawn or not. This property does not
69 * effect visibility of markers and text labels.
70 *
71 * This is useful for e.g. bubble charts where you need circular markers
72 * but want no connecting lines to be drawn.
73 *
74 * By default lines are drawn, i.e. this property is true.
75 */
76 void setVisible( bool visible );
77 bool isVisible() const;
78
79 void setDisplayArea( bool display );
80 bool displayArea() const;
81 /*allows viewing the covered areas*/
82 void setTransparency( uint alpha );
83 uint transparency() const;
84
85 bool operator==( const LineAttributes& ) const;
86 inline bool operator!=( const LineAttributes& other ) const { return !operator==(other); }
87
88private:
89 KCHART_DECLARE_PRIVATE_BASE_VALUE( LineAttributes )
90}; // End of class LineAttributes
91
92}
93
94#if !defined(QT_NO_DEBUG_STREAM)
95KCHART_EXPORT QDebug operator<<(QDebug, const KChart::LineAttributes& );
96#endif /* QT_NO_DEBUG_STREAM */
97
98KCHART_DECLARE_SWAP_SPECIALISATION( KChart::LineAttributes )
99
100QT_BEGIN_NAMESPACE
101Q_DECLARE_TYPEINFO( KChart::LineAttributes, Q_MOVABLE_TYPE );
102QT_END_NAMESPACE
103
104Q_DECLARE_METATYPE( KChart::LineAttributes )
105
106#endif // KCHARTLINEATTRIBUTES_H
Contains KChart macros.
Set of attributes for changing the appearance of line charts.
MissingValuesPolicy
MissingValuesPolicy specifies how a missing value will be shown in a line diagram.
KCALENDARCORE_EXPORT QDataStream & operator<<(QDataStream &out, const KCalendarCore::Alarm::Ptr &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.