inherits documentation from base class */
| 24024 | |
| 24025 | /* inherits documentation from base class */ |
| 24026 | QPointF QCPBars::dataPixelPosition(int index) const |
| 24027 | { |
| 24028 | if (index >= 0 && index < mDataContainer->size()) |
| 24029 | { |
| 24030 | QCPAxis *keyAxis = mKeyAxis.data(); |
| 24031 | QCPAxis *valueAxis = mValueAxis.data(); |
| 24032 | if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return QPointF(); } |
| 24033 | |
| 24034 | const QCPDataContainer<QCPBarsData>::const_iterator it = mDataContainer->constBegin()+index; |
| 24035 | const double valuePixel = valueAxis->coordToPixel(getStackedBaseValue(it->key, it->value >= 0) + it->value); |
| 24036 | const double keyPixel = keyAxis->coordToPixel(it->key) + (mBarsGroup ? mBarsGroup->keyPixelOffset(this, it->key) : 0); |
| 24037 | if (keyAxis->orientation() == Qt::Horizontal) |
| 24038 | return QPointF(keyPixel, valuePixel); |
| 24039 | else |
| 24040 | return QPointF(valuePixel, keyPixel); |
| 24041 | } else |
| 24042 | { |
| 24043 | qDebug() << Q_FUNC_INFO << "Index out of bounds" << index; |
| 24044 | return QPointF(); |
| 24045 | } |
| 24046 | } |
| 24047 | |
| 24048 | /* inherits documentation from base class */ |
| 24049 | void QCPBars::draw(QCPPainter *painter) |
no test coverage detected