Search for usage in LXR

KPlotAxis Class Reference

#include <kplotaxis.h>

Public Member Functions

 KPlotAxis (const QString &label=QString())
 ~KPlotAxis ()
bool areTickLabelsShown () const
bool isVisible () const
QString label () const
QList< double > majorTickMarks () const
QList< double > minorTickMarks () const
void setLabel (const QString &label)
void setTickLabelFormat (char format= 'g', int fieldWidth=0, int precision=-1)
void setTickLabelsShown (bool b)
void setTickMarks (double x0, double length)
void setVisible (bool visible)
QString tickLabel (double value) const
char tickLabelFormat () const
int tickLabelPrecision () const
int tickLabelWidth () const

Detailed Description

Axis for KPlotWidget.

Contains all data for drawing an axis including format specification axis labels.

Andreas Nicolai

Definition at line 24 of file kplotaxis.h.

Constructor & Destructor Documentation

KPlotAxis::KPlotAxis ( const QString label = QString())

Constructor, constructs an axis with the label label.

Definition at line 36 of file kplotaxis.cpp.

KPlotAxis::~KPlotAxis ( )


Definition at line 42 of file kplotaxis.cpp.

Member Function Documentation

bool KPlotAxis::areTickLabelsShown ( ) const
whether tick labels will be drawn for this axis

Definition at line 57 of file kplotaxis.cpp.

bool KPlotAxis::isVisible ( ) const
whether the axis is visible or not

Definition at line 47 of file kplotaxis.cpp.

QString KPlotAxis::label ( ) const
the label string for this axis

Definition at line 72 of file kplotaxis.cpp.

QList< double > KPlotAxis::majorTickMarks ( ) const
the list of coordinates of the major tickmarks for this axis
the positions of tickmarks are automatically computed by setTickMarks().
See also

Definition at line 184 of file kplotaxis.cpp.

QList< double > KPlotAxis::minorTickMarks ( ) const
the list with the minor tickmarks
the positions of tickmarks are automatically computed by setTickMarks().
See also

Definition at line 189 of file kplotaxis.cpp.

void KPlotAxis::setLabel ( const QString label)

Sets the axis label.

Set the label to an empty string to omit the axis label.

labela string describing the data plotted on the axis.

Definition at line 67 of file kplotaxis.cpp.

void KPlotAxis::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 tick label.

Normally, the format character is one of 'e', 'E', 'f', 'g', or 'G' (see the documentation for QString::arg(double) for details).

In addition, it is possible to set the format character to 't'; in this case the tickmark value is interpreted as a time in hours, and the ticklabel string will be in "hh:mm" clock format. Note that when the format character is 't', the fieldWidth and prec values are ignored.

formatthe format specification character
fieldWidththe number of characters in the output string. If set to 0, the string will be as wide as it needs to be to fully render the value.
precisionthe number of characters following the decimal point.

Definition at line 77 of file kplotaxis.cpp.

void KPlotAxis::setTickLabelsShown ( bool  b)

Determine whether tick labels will be drawn for this axis.

bif true, tick labels will be drawn.

Definition at line 62 of file kplotaxis.cpp.

void KPlotAxis::setTickMarks ( double  x0,
double  length 

Determine the positions of major and minor tickmarks for this axis.

this function is called by KPlotWidget whenever the plot's limits are modified.
x0the minimum data coordinate of the axis.
lengththe range covered by the axis, in data units.
See also

Definition at line 99 of file kplotaxis.cpp.

void KPlotAxis::setVisible ( bool  visible)

Sets the "visible" property of the axis.

visibleif true, this axis will be drawn on the KPlotWidget

Definition at line 52 of file kplotaxis.cpp.

QString KPlotAxis::tickLabel ( double  value) const
the ticklabel string for the given value, rendered according to the current format specification.
thevalue to be rendered as a tick label.
See also

Definition at line 166 of file kplotaxis.cpp.

char KPlotAxis::tickLabelFormat ( ) const
the number format of the tick labels

Definition at line 89 of file kplotaxis.cpp.

int KPlotAxis::tickLabelPrecision ( ) const
the number precision of the tick labels

Definition at line 94 of file kplotaxis.cpp.

int KPlotAxis::tickLabelWidth ( ) const
the field width of the tick labels

Definition at line 84 of file kplotaxis.cpp.

The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Mar 2 2021 00:57:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.