KPlotting 5.109.0
kplotaxis.h
1/* -*- C++ -*-
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2005 Andreas Nicolai <Andreas.Nicolai@gmx.net>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KPLOTAXIS_H
9#define KPLOTAXIS_H
10
11#include <kplotting_export.h>
12
13#include <QList>
14#include <QString>
15
24class KPLOTTING_EXPORT KPlotAxis
25{
26public:
30 explicit KPlotAxis(const QString &label = QString());
31
36
40 bool isVisible() const;
41
46 void setVisible(bool visible);
47
51 bool areTickLabelsShown() const;
52
57 void setTickLabelsShown(bool b);
58
64 void setLabel(const QString &label);
65
69 QString label() const;
70
77 QString tickLabel(double value) const;
78
98 void setTickLabelFormat(char format = 'g', int fieldWidth = 0, int precision = -1);
99
103 int tickLabelWidth() const;
104
108 char tickLabelFormat() const;
109
114
124 void setTickMarks(double x0, double length);
125
132 QList<double> majorTickMarks() const;
133
140 QList<double> minorTickMarks() const;
141
142private:
143 class Private;
144 Private *const d;
145
146 Q_DISABLE_COPY(KPlotAxis)
147};
148
149#endif // KPLOTAXIS_H
Axis for KPlotWidget.
Definition kplotaxis.h:25
QList< double > majorTickMarks() const
void setTickMarks(double x0, double length)
Determine the positions of major and minor tickmarks for this axis.
int tickLabelPrecision() const
char tickLabelFormat() const
bool isVisible() const
void setLabel(const QString &label)
Sets the axis label.
~KPlotAxis()
Destructor.
QString label() const
void setTickLabelFormat(char format='g', int fieldWidth=0, int precision=-1)
Set the display format for converting the double value of the tick's position to the QString for the ...
KPlotAxis(const QString &label=QString())
Constructor, constructs an axis with the label label.
void setTickLabelsShown(bool b)
Determine whether tick labels will be drawn for this axis.
void setVisible(bool visible)
Sets the "visible" property of the axis.
bool areTickLabelsShown() const
QList< double > minorTickMarks() const
int tickLabelWidth() const
QString tickLabel(double value) const