inherits documentation from base class */
| 24817 | |
| 24818 | /* inherits documentation from base class */ |
| 24819 | QPointF QCPBars::dataPixelPosition(int index) const |
| 24820 | { |
| 24821 | if (index >= 0 && index < mDataContainer->size()) |
| 24822 | { |
| 24823 | QCPAxis *keyAxis = mKeyAxis.data(); |
| 24824 | QCPAxis *valueAxis = mValueAxis.data(); |
| 24825 | if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return {}; } |
| 24826 | |
| 24827 | const QCPDataContainer<QCPBarsData>::const_iterator it = mDataContainer->constBegin()+index; |
| 24828 | const double valuePixel = valueAxis->coordToPixel(getStackedBaseValue(it->key, it->value >= 0) + it->value); |
| 24829 | const double keyPixel = keyAxis->coordToPixel(it->key) + (mBarsGroup ? mBarsGroup->keyPixelOffset(this, it->key) : 0); |
| 24830 | if (keyAxis->orientation() == Qt::Horizontal) |
| 24831 | return {keyPixel, valuePixel}; |
| 24832 | else |
| 24833 | return {valuePixel, keyPixel}; |
| 24834 | } else |
| 24835 | { |
| 24836 | qDebug() << Q_FUNC_INFO << "Index out of bounds" << index; |
| 24837 | return {}; |
| 24838 | } |
| 24839 | } |
| 24840 | |
| 24841 | /* inherits documentation from base class */ |
| 24842 | void QCPBars::draw(QCPPainter *painter) |
no test coverage detected