KChart
KChartCartesianAxis.cpp
50 QString sample = QString::number( floatNumber, 'f', maxPlaces ).section( QLatin1Char('.'), 1, 2 );
60// Feature idea: In case of numeric labels, consider limiting the possible values of majorThinningFactor
61// to something like {1, 2, 5} * 10^n. Or even better, something that achieves round values in the
64// ensure we take the const-overload of any following function, esp. required for strict iterators
71TickIterator::TickIterator( CartesianAxis* a, CartesianCoordinatePlane* plane, uint majorThinningFactor,
136static QMap< qreal, QString > allAxisAnnotations( const AbstractCoordinatePlane *plane, bool isY )
141 const AbstractCartesianDiagram *cd = qobject_cast< const AbstractCartesianDiagram* >( diagram );
156TickIterator::TickIterator( bool isY, const DataDimension& dimension, bool useAnnotationsForTicks,
199 // the number of significant decimal places for each label naturally varies with logarithmic scaling
312 // So currently, we bail and show no tick at all for empty ranges > 10^6, but at least we don't hang.
343 if ( isHigherPrecedence( m_customTick, m_majorTick ) && isHigherPrecedence( m_customTick, m_minorTick ) ) {
346 // override the MajorTick type here because those tick's labels are collision-tested, which we don't want
347 // for custom ticks. they may be arbitrarily close to other ticks, causing excessive label thinning.
471 // Invalidating size is not always necessary if both old and new positions are horizontal or both
472 // vertical, but in practice there could be small differences due to who-knows-what, so always adapt
523 const Qt::Orientation diagramOrientation = referenceDiagramIsBarDiagram( d->diagram() ) ? ( ( BarDiagram* )( d->diagram() ) )->orientation()
548 // (the alternative to clipping when zoomed in requires much more work to paint just the right area)
551 painter->setClipRegion( areaGeometry().adjusted( - d->amountOfLeftOverlap - 1, - d->amountOfTopOverlap - 1,
573QString CartesianAxis::Private::customizedLabelText( const QString& text, Qt::Orientation orientation,
610 TextLayoutItem titleItem( titleText, titleTA, plane->parent(), KChartEnums::MeasureOrientationMinimum,
654 CartesianCoordinatePlane* plane = dynamic_cast<CartesianCoordinatePlane*>( context->coordinatePlane() );
664 const bool centerTicks = referenceDiagramNeedsCenteredAbscissaTicks( d->diagram() ) && isAbscissa();
775 // those adjustments are required to paint the ticks exactly on the axis and of the right length
966 CartesianCoordinatePlane* plane = dynamic_cast< CartesianCoordinatePlane* >( diagram()->coordinatePlane() );
1063 TextLayoutItem title( axis()->titleText(), titleTA, refArea, KChartEnums::MeasureOrientationMinimum,
QRect areaGeometry() const override
Definition KChartAbstractArea.cpp:137
RulerAttributes rulerAttributes() const
Returns the attributes to be used for painting the rulers.
Definition KChartAbstractAxis.cpp:194
virtual const QString customizedLabel(const QString &label) const
Reimplement this method if you want to adjust axis labels before they are printed.
Definition KChartAbstractAxis.cpp:147
bool compare(const AbstractAxis *other) const
Returns true if both axes have the same settings.
Definition KChartAbstractAxis.cpp:131
TextAttributes textAttributes() const
Returns the text attributes to be used for axis labels.
Definition KChartAbstractAxis.cpp:182
Base class for diagrams based on a cartesian coordianate system.
Definition KChartAbstractCartesianDiagram.h:28
virtual KChart::CartesianAxisList axes() const
Definition KChartAbstractCartesianDiagram.cpp:90
virtual AbstractCartesianDiagram * referenceDiagram() const
Definition KChartAbstractCartesianDiagram.cpp:140
virtual void takeAxis(CartesianAxis *axis)
Removes the axis from the diagram, without deleting it.
Definition KChartAbstractCartesianDiagram.cpp:80
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane,...
Definition KChartAbstractCoordinatePlane.h:31
void layoutPlanes()
Calling layoutPlanes() on the plane triggers the global KChart::Chart::slotLayoutPlanes()
Definition KChartAbstractCoordinatePlane.cpp:249
virtual qreal zoomFactorY() const
Definition KChartAbstractCoordinatePlane.h:132
AbstractDiagramList diagrams()
Definition KChartAbstractCoordinatePlane.cpp:124
AbstractDiagram * diagram()
Definition KChartAbstractCoordinatePlane.cpp:114
virtual qreal zoomFactorX() const
Definition KChartAbstractCoordinatePlane.h:126
DataDimensionsList gridDimensionsList()
Returns the dimensions used for drawing the grid lines.
Definition KChartAbstractCoordinatePlane.cpp:152
AbstractDiagram defines the interface for diagram classes.
Definition KChartAbstractDiagram.h:37
virtual AttributesModel * attributesModel() const
Returns the AttributesModel, that is used by this diagram.
Definition KChartAbstractDiagram.cpp:187
QString unitPrefix(int column, Qt::Orientation orientation, bool fallback=false) const
Retrieves the axis unit prefix for a specific column.
Definition KChartAbstractDiagram.cpp:952
AbstractCoordinatePlane * coordinatePlane() const
The coordinate plane associated with the diagram.
Definition KChartAbstractDiagram.cpp:96
QStringList itemRowLabels() const
The set of item row labels currently displayed, for use in Abscissa axes, etc.
Definition KChartAbstractDiagram.cpp:1058
QString unitSuffix(int column, Qt::Orientation orientation, bool fallback=false) const
Retrieves the axis unit suffix for a specific column.
Definition KChartAbstractDiagram.cpp:975
static const DataDimension adjustedLowerUpperRange(const DataDimension &dim, bool adjustLower, bool adjustUpper)
Adjusts dim so that dim.start and/or dim.end are a multiple of dim.stepWidth.
Definition KChartAbstractGrid.cpp:95
A proxy model used for decorating data with attributes.
Definition KChartAttributesModel.h:33
void resetTitleTextAttributes()
Reset the title text attributes to the built-in default:
Definition KChartCartesianAxis.cpp:453
void setCustomTickLength(int value)
Sets the length of custom ticks on the axis.
Definition KChartCartesianAxis.cpp:1102
void setGeometry(const QRect &r) override
pure virtual in QLayoutItem
Definition KChartCartesianAxis.cpp:1088
QList< qreal > customTicks() const
Returns the currently set custom ticks on the axis.
Definition KChartCartesianAxis.cpp:1138
QMap< qreal, QString > annotations() const
Returns the currently set axis annotations.
Definition KChartCartesianAxis.cpp:1123
CartesianAxis(AbstractCartesianDiagram *diagram=nullptr)
C'tor of the class for cartesian axes.
Definition KChartCartesianAxis.cpp:374
int customTickLength() const
Returns the length of custom ticks on the axis.
Definition KChartCartesianAxis.cpp:1112
QSize minimumSize() const override
pure virtual in QLayoutItem
Definition KChartCartesianAxis.cpp:1076
Qt::Orientations expandingDirections() const override
pure virtual in QLayoutItem
Definition KChartCartesianAxis.cpp:928
bool compare(const CartesianAxis *other) const
Returns true if both axes have the same settings.
Definition KChartCartesianAxis.cpp:403
TextAttributes titleTextAttributes() const
Returns the text attributes that will be used for displaying the title text.
Definition KChartCartesianAxis.cpp:441
void setTitleText(const QString &text)
Sets the optional text displayed as axis title.
Definition KChartCartesianAxis.cpp:421
void setCustomTicks(const QList< qreal > &ticksPostions)
Sets custom ticks on the axis.
Definition KChartCartesianAxis.cpp:1143
void setAnnotations(const QMap< qreal, QString > &annotations)
Sets the axis annotations to annotations.
Definition KChartCartesianAxis.cpp:1128
void setTitleSpace(qreal value)
Definition KChartCartesianAxis.cpp:583
void setTitleSize(qreal value)
use setTitleTextAttributes() instead
Definition KChartCartesianAxis.cpp:593
Cartesian coordinate plane.
Definition KChartCartesianCoordinatePlane.h:26
unsigned int autoAdjustVerticalRangeToData() const
Returns the maximal allowed percent of the vertical space covered by the coordinate plane that may be...
Definition KChartCartesianCoordinatePlane.cpp:700
unsigned int autoAdjustHorizontalRangeToData() const
Returns the maximal allowed percent of the horizontal space covered by the coordinate plane that may ...
Definition KChartCartesianCoordinatePlane.cpp:695
const QPointF translate(const QPointF &diagramPoint) const override
Translate the given point in value space coordinates to a position in pixel space.
Definition KChartCartesianCoordinatePlane.cpp:442
const GridAttributes gridAttributes(Qt::Orientation orientation) const
Definition KChartCartesianCoordinatePlane.cpp:724
Helper class for one dimension of data, e.g.
Definition KChartAbstractCoordinatePlane.h:364
static QPaintDevice * paintDevice()
Return the paint device to use for calculating font metrics.
Definition KChartMeasure.cpp:211
A set of attributes controlling the appearance of grids.
Definition KChartGridAttributes.h:26
bool centerDataPoints() const
Definition KChartLineDiagram.cpp:139
Measure is used to specify relative and absolute sizes in KChart, e.g.
Definition KChartMeasure.h:38
A set of attributes controlling the appearance of axis rulers.
Definition KChartRulerAttributes.h:26
void setTextAttributes(const TextAttributes &a)
Use this to specify the text attributes to be used for this item.
Definition KChartLayoutItems.cpp:242
void setGeometry(const QRect &r) override
pure virtual in QLayoutItem
Definition KChartLayoutItems.cpp:283
Q_SCRIPTABLE Q_NOREPLY void start()
int decimalPlaces(const int rangeMax, const int significantFigures)
QCA_EXPORT void init()
qreal height() const const
const_reference at(qsizetype i) const const
qsizetype count() const const
T & first()
bool isEmpty() const const
T & last()
iterator insert(const Key &key, const T &value)
Key key(const T &value, const Key &defaultKey) const const
T value(const Key &key, const T &defaultValue) const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
T qobject_cast(QObject *object)
void drawLine(const QLine &line)
void restore()
void save()
void setClipRegion(const QRegion ®ion, Qt::ClipOperation operation)
void setClipping(bool enable)
void setPen(Qt::PenStyle style)
void translate(const QPoint &offset)
int x() const const
int y() const const
void setX(qreal x)
void setY(qreal y)
qreal x() const const
qreal y() const const
int bottom() const const
int height() const const
int left() const const
int right() const const
int top() const const
int width() const const
int height() const const
void setHeight(int height)
void setWidth(int width)
int width() const const
qreal height() const const
QSize toSize() const const
qreal width() const const
bool isEmpty() const const
QString number(double n, char format, int precision)
QString section(QChar sep, qsizetype start, qsizetype end, SectionFlags flags) const const
AlignHCenter
Horizontal
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:24 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:24 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.