Avogadro
1.1.0
|
Axis for PlotWidget. More...
#include <avogadro/plotaxis.h>
Public Member Functions | |
PlotAxis (const QString &label=QString()) | |
~PlotAxis () | |
bool | isVisible () const |
void | setVisible (bool visible) |
bool | areTickLabelsShown () const |
void | setTickLabelsShown (bool b) |
void | setLabel (const QString &label) |
QString | label () const |
QString | tickLabel (double value) const |
void | setTickLabelFormat (char format= 'g', int fieldWidth=0, int precision=-1) |
int | tickLabelWidth () const |
char | tickLabelFormat () const |
int | tickLabelPrecision () const |
void | setTickMarks (double x0, double length) |
QList< double > | majorTickMarks () const |
QList< double > | minorTickMarks () const |
Axis for PlotWidget.
Contains all data for drawing an axis including format specification axis labels.
Avogadro::PlotAxis::PlotAxis | ( | const QString & | label = QString() | ) | [explicit] |
Constructor, constructs an axis with the label label
.
References label().
Destructor.
bool Avogadro::PlotAxis::areTickLabelsShown | ( | ) | const |
Referenced by Avogadro::PlotWidget::drawAxes(), and Avogadro::PlotWidget::saveImage().
bool Avogadro::PlotAxis::isVisible | ( | ) | const |
Referenced by Avogadro::PlotWidget::drawAxes(), and Avogadro::PlotWidget::saveImage().
QString Avogadro::PlotAxis::label | ( | ) | const |
Referenced by Avogadro::PlotWidget::drawAxes(), PlotAxis(), Avogadro::PlotWidget::saveImage(), and setLabel().
QList< double > Avogadro::PlotAxis::majorTickMarks | ( | ) | const |
Referenced by Avogadro::PlotWidget::drawAxes(), and Avogadro::PlotWidget::saveImage().
QList< double > Avogadro::PlotAxis::minorTickMarks | ( | ) | const |
Referenced by Avogadro::PlotWidget::drawAxes(), and Avogadro::PlotWidget::saveImage().
void Avogadro::PlotAxis::setLabel | ( | const QString & | label | ) |
Sets the axis label. Set the label to an empty string to omit the axis label.
label | a string describing the data plotted on the axis. |
References label().
Referenced by Avogadro::PlotWidget::resetPlot().
void Avogadro::PlotAxis::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.
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. |
void Avogadro::PlotAxis::setTickLabelsShown | ( | bool | b | ) |
Determine whether tick labels will be drawn for this axis.
b | if true, tick labels will be drawn. |
Referenced by Avogadro::PlotWidget::resetPlot().
void Avogadro::PlotAxis::setTickMarks | ( | double | x0, |
double | length | ||
) |
Determine the positions of major and minor tickmarks for this axis.
x0 | the minimum data coordinate of the axis. |
length | the range covered by the axis, in data units. |
Referenced by Avogadro::PlotWidget::clearSecondaryLimits(), and Avogadro::PlotWidget::setSecondaryLimits().
void Avogadro::PlotAxis::setVisible | ( | bool | visible | ) |
Sets the "visible" property of the axis.
visible | if true, this axis will be drawn on the PlotWidget |
QString Avogadro::PlotAxis::tickLabel | ( | double | value | ) | const |
the | value to be rendered as a tick label. |
References QString::arg().
Referenced by Avogadro::PlotWidget::drawAxes(), and Avogadro::PlotWidget::saveImage().
char Avogadro::PlotAxis::tickLabelFormat | ( | ) | const |
int Avogadro::PlotAxis::tickLabelPrecision | ( | ) | const |
int Avogadro::PlotAxis::tickLabelWidth | ( | ) | const |