inherits documentation from base class */
| 24782 | |
| 24783 | /* inherits documentation from base class */ |
| 24784 | QPointF QCPBars::dataPixelPosition(int index) const |
| 24785 | { |
| 24786 | if (index >= 0 && index < mDataContainer->size()) |
| 24787 | { |
| 24788 | QCPAxis *keyAxis = mKeyAxis.data(); |
| 24789 | QCPAxis *valueAxis = mValueAxis.data(); |
| 24790 | if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return {}; } |
| 24791 | |
| 24792 | const QCPDataContainer<QCPBarsData>::const_iterator it = mDataContainer->constBegin()+index; |
| 24793 | const double valuePixel = valueAxis->coordToPixel(getStackedBaseValue(it->key, it->value >= 0) + it->value); |
| 24794 | const double keyPixel = keyAxis->coordToPixel(it->key) + (mBarsGroup ? mBarsGroup->keyPixelOffset(this, it->key) : 0); |
| 24795 | if (keyAxis->orientation() == Qt::Horizontal) |
| 24796 | return {keyPixel, valuePixel}; |
| 24797 | else |
| 24798 | return {valuePixel, keyPixel}; |
| 24799 | } else |
| 24800 | { |
| 24801 | qDebug() << Q_FUNC_INFO << "Index out of bounds" << index; |
| 24802 | return {}; |
| 24803 | } |
| 24804 | } |
| 24805 | |
| 24806 | /* inherits documentation from base class */ |
| 24807 | void QCPBars::draw(QCPPainter *painter) |
no test coverage detected