• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KPlotAxis Class Reference

Axis for KPlotWidget. More...

#include <kplotaxis.h>

List of all members.

Public Member Functions

bool areTickLabelsShown () const
bool isVisible () const
 KPlotAxis (const QString &label=QString())
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
 ~KPlotAxis ()

Detailed Description

Axis for KPlotWidget.

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

Author:
Andreas Nicolai
Version:
1.0

Definition at line 37 of file kplotaxis.h.


Constructor & Destructor Documentation

KPlotAxis::KPlotAxis ( const QString &  label = QString()  )  [explicit]

Constructor, constructs an axis with the label label.

Definition at line 50 of file kplotaxis.cpp.

KPlotAxis::~KPlotAxis (  ) 

Destructor.

Definition at line 56 of file kplotaxis.cpp.


Member Function Documentation

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

Definition at line 71 of file kplotaxis.cpp.

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

Definition at line 61 of file kplotaxis.cpp.

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

Definition at line 86 of file kplotaxis.cpp.

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

Definition at line 191 of file kplotaxis.cpp.

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

Definition at line 196 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.

Parameters:
label a string describing the data plotted on the axis.

Definition at line 81 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.

Parameters:
format the format specification character
fieldWidth the 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.
precision the number of characters following the decimal point.

Definition at line 91 of file kplotaxis.cpp.

void KPlotAxis::setTickLabelsShown ( bool  b  ) 

Determine whether tick labels will be drawn for this axis.

Parameters:
b if true, tick labels will be drawn.

Definition at line 76 of file kplotaxis.cpp.

void KPlotAxis::setTickMarks ( double  x0,
double  length 
)

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

Note:
this function is called by KPlotWidget whenever the plot's limits are modified.
Parameters:
x0 the minimum data coordinate of the axis.
length the range covered by the axis, in data units.
See also:
majorTickMarks()
minorTickMarks()

Definition at line 113 of file kplotaxis.cpp.

void KPlotAxis::setVisible ( bool  visible  ) 

Sets the "visible" property of the axis.

Parameters:
visible if true, this axis will be drawn on the KPlotWidget

Definition at line 66 of file kplotaxis.cpp.

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

Definition at line 178 of file kplotaxis.cpp.

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

Definition at line 103 of file kplotaxis.cpp.

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

Definition at line 108 of file kplotaxis.cpp.

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

Definition at line 98 of file kplotaxis.cpp.


The documentation for this class was generated from the following files:
  • kplotaxis.h
  • kplotaxis.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal