KQuickCharts
LineChart.cpp
25QVector2D cubicHermite(const QVector2D &first, const QVector2D &second, float step, float mFirst, float mSecond);
217 auto result = QVector2D{direction() == Direction::ZeroAtStart ? i * stepSize : float(boundingRect().right()) - i * stepSize, value};
231 << "has a different number of elements from the previous source. Ignoring stacking for this source.";
287 auto fillColor = m_fillColorSource ? m_fillColorSource->item(i).value<QColor>() : colorWithAlpha(color, m_fillOpacity);
316void LineChart::updateLineNode(LineChartNode *node, const QColor &lineColor, const QColor &fillColor, ChartDataSource *valueSource)
339 auto delegate = qobject_cast<QQuickItem *>(m_pointDelegate->beginCreate(qmlContext(m_pointDelegate)));
341 qWarning() << "Delegate creation for point" << i << "of value source" << valueSource->objectName()
358void LineChart::updatePointDelegate(QQuickItem *delegate, const QVector2D &position, const QVariant &value, int sourceIndex)
360 auto pos = QPointF{position.x() - delegate->width() / 2, (1.0 - position.y()) * height() - delegate->height() / 2};
363 auto attached = static_cast<LineChartAttached *>(qmlAttachedPropertiesObject<LineChart>(delegate, true));
365 attached->setColor(colorSource() ? colorSource()->item(sourceIndex).value<QColor>() : Qt::black);
367 attached->setShortName(shortNameSource() ? shortNameSource()->item(sourceIndex).toString() : QString{});
482QVector2D cubicHermite(const QVector2D &first, const QVector2D &second, float step, float mFirst, float mSecond)
497 auto result = QVector2D{step, first.y() * h00 + delta * mFirst * h10 + second.y() * h01 + delta * mSecond * h11};
ChartDataSource * shortNameSource
The data source to use for short names of chart items.
Definition Chart.h:54
QQmlListProperty< ChartDataSource > valueSources
The data sources providing the data this chart needs to render.
Definition Chart.h:70
An attached property that is exposed to point delegates created in line charts.
Definition LineChart.h:25
ChartDataSource * fillColorSource
A data source that supplies color values for the line charts' fill area.
Definition LineChart.h:119
QQmlComponent * pointDelegate
A delegate that will be placed at each line chart point.
Definition LineChart.h:135
bool interpolate
Interpolate the values in the chart so that the lines become smoothed.
Definition LineChart.h:92
void onDataChanged() override
Called when the data of a value source changes.
Definition LineChart.cpp:302
ComputedRange computedRange() const
Get the complete, calculated range for this chart.
Definition XYChart.cpp:69
@ ZeroAtStart
Zero is at the beginning of the chart, values run from begin to end.
char * toString(const EngineQuery &query)
const QList< QKeySequence > & next()
void setRedF(float red)
void clear()
iterator insert(const Key &key, const T &value)
QList< Key > keys() const const
bool remove(const Key &key)
T value(const Key &key) const const
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
T & first()
bool isEmpty() const const
T & last()
void reserve(qsizetype size)
qsizetype size() const const
Q_EMITQ_EMIT
objectName
virtual QObject * beginCreate(QQmlContext *context)
virtual void completeCreate()
QQuickItem(QQuickItem *parent)
virtual QRectF boundingRect() const const
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
height
opacity
void polish()
void update()
width
QQuickWindow * window() const const
void appendChildNode(QSGNode *node)
QSGNode * childAtIndex(int i) const const
int childCount() const const
void removeChildNode(QSGNode *node)
bool isEmpty() const const
black
QTextStream & right(QTextStream &stream)
T value() const const
float x() const const
float y() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:57 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:13:57 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.