KChart

KChartLeveyJenningsAxis.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 KCHARTLEVEYJENNINGSAXIS_H
10#define KCHARTLEVEYJENNINGSAXIS_H
11
12#include <QList>
13
14#include "KChartCartesianAxis.h"
15
16#include "KChartLeveyJenningsGridAttributes.h"
17
18namespace KChart {
19
20 class LeveyJenningsDiagram;
21
22 /**
23 * The class for levey jennings axes.
24 *
25 * For being useful, axes need to be assigned to a diagram, see
26 * LeveyJenningsDiagram::addAxis and LeveyJenningsDiagram::takeAxis.
27 *
28 * \sa PolarAxis, AbstractCartesianDiagram
29 */
30 class KCHART_EXPORT LeveyJenningsAxis : public CartesianAxis
31 {
32 Q_OBJECT
33
34 Q_DISABLE_COPY( LeveyJenningsAxis )
35 KCHART_DECLARE_PRIVATE_DERIVED_PARENT( LeveyJenningsAxis, AbstractDiagram* )
36
37 public:
38 /**
39 * C'tor of the class for levey jennings axes.
40 *
41 * \note If using a zero parent for the constructor, you need to call
42 * your diagram's addAxis function to add your axis to the diagram.
43 * Otherwise, there is no need to call addAxis, since the constructor
44 * does that automatically for you, if you pass a diagram as parameter.
45 *
46 * \sa AbstractCartesianDiagram::addAxis
47 */
48 explicit LeveyJenningsAxis ( LeveyJenningsDiagram* diagram = nullptr );
49 ~LeveyJenningsAxis() override;
50
51 /**
52 * @return The axis' type.
53 */
54 LeveyJenningsGridAttributes::GridType type() const;
55
56 /**
57 * Sets the type of the axis to \a type.
58 * This method colors the label to the default color of the
59 * respective type.
60 * Please make sure to re-set the colors after calling this,
61 * if you want them different.
62 * Setting the type is only valid for axes located right or left
63 * from the diagram. An axis on the bottom always shows the timeline.
64 */
65 void setType( LeveyJenningsGridAttributes::GridType type );
66
67 Qt::DateFormat dateFormat() const;
68 void setDateFormat( Qt::DateFormat format );
69
70 /**
71 * Returns true if both axes have the same settings.
72 */
73 bool compare( const LeveyJenningsAxis* other ) const;
74
75 /** reimpl */
76 void paintCtx( PaintContext* ) override;
77
78 protected:
79 virtual void paintAsOrdinate( PaintContext* );
80
81 virtual void paintAsAbscissa( PaintContext* );
82 };
83
85}
86
87#endif
AbstractDiagram defines the interface for diagram classes.
The class for cartesian axes.
The class for levey jennings axes.
LeveyDiagram defines a Levey Jennings chart.
Stores information about painting diagrams.
DateFormat
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:54:44 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.