QCPAxisTickerText specialisation that elides tick labels to fit within the available axis space, preventing text overflow on crowded or narrow axes.
More...
#include <qcp_axis_ticker_elided.h>
|
| | QCPAxisTickerElided (QCPAxis *parent) |
| | Constructs a QCPAxisTickerElided bound to the given axis.
|
| |
| QString | elidedText (const QString &text) |
| | Returns text elided to fit within the available tick-label width of the parent axis, appending an ellipsis if truncation is needed.
|
| |
|
| static QCP::MarginSide | axisTypeToMarginSide (const QCPAxis::AxisType axisType) |
| | Converts a QCPAxis AxisType to its corresponding QCP::MarginSide.
|
| |
|
| virtual QString | getTickLabel (double tick, const QLocale &locale, QChar formatChar, int precision) override |
| | Returns the (possibly elided) label string for the tick at tick.
|
| |
QCPAxisTickerText specialisation that elides tick labels to fit within the available axis space, preventing text overflow on crowded or narrow axes.
◆ QCPAxisTickerElided()
| QCPAxisTickerElided::QCPAxisTickerElided |
( |
QCPAxis * |
parent | ) |
|
|
explicit |
Constructs a QCPAxisTickerElided bound to the given axis.
- Parameters
-
| parent | The QCPAxis whose tick labels this ticker will generate and elide. |
◆ axisTypeToMarginSide()
| QCP::MarginSide QCPAxisTickerElided::axisTypeToMarginSide |
( |
const QCPAxis::AxisType |
axisType | ) |
|
|
static |
Converts a QCPAxis AxisType to its corresponding QCP::MarginSide.
QCustomPlot provides QCP::marginSideToAxisType() but not the inverse; this utility fills that gap.
- Parameters
-
| axisType | The axis type to convert (Left, Right, Top, or Bottom). |
- Returns
- The QCP::MarginSide that corresponds to
axisType.
◆ elidedText()
| QString QCPAxisTickerElided::elidedText |
( |
const QString & |
text | ) |
|
Returns text elided to fit within the available tick-label width of the parent axis, appending an ellipsis if truncation is needed.
- Parameters
-
| text | The full label string to elide. |
- Returns
- The elided string, or
text unchanged if it already fits.
◆ getTickLabel()
| QString QCPAxisTickerElided::getTickLabel |
( |
double |
tick, |
|
|
const QLocale & |
locale, |
|
|
QChar |
formatChar, |
|
|
int |
precision |
|
) |
| |
|
overrideprotectedvirtual |
Returns the (possibly elided) label string for the tick at tick.
Overrides QCPAxisTickerText to apply elision before the label is rendered.
- Parameters
-
| tick | Axis coordinate of the tick being labelled. |
| locale | Locale used for number formatting. |
| formatChar | printf-style format character for numeric ticks. |
| precision | Number of decimal places for numeric tick labels. |
- Returns
- Elided tick label string.
The documentation for this class was generated from the following files: