inherits documentation from base class */
| 23955 | |
| 23956 | /* inherits documentation from base class */ |
| 23957 | QPointF QCPBars::dataPixelPosition(int index) const |
| 23958 | { |
| 23959 | if (index >= 0 && index < mDataContainer->size()) |
| 23960 | { |
| 23961 | QCPAxis *keyAxis = mKeyAxis.data(); |
| 23962 | QCPAxis *valueAxis = mValueAxis.data(); |
| 23963 | if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return QPointF(); } |
| 23964 | |
| 23965 | const QCPDataContainer<QCPBarsData>::const_iterator it = mDataContainer->constBegin()+index; |
| 23966 | const double valuePixel = valueAxis->coordToPixel(getStackedBaseValue(it->key, it->value >= 0) + it->value); |
| 23967 | const double keyPixel = keyAxis->coordToPixel(it->key) + (mBarsGroup ? mBarsGroup->keyPixelOffset(this, it->key) : 0); |
| 23968 | if (keyAxis->orientation() == Qt::Horizontal) |
| 23969 | return QPointF(keyPixel, valuePixel); |
| 23970 | else |
| 23971 | return QPointF(valuePixel, keyPixel); |
| 23972 | } else |
| 23973 | { |
| 23974 | qDebug() << Q_FUNC_INFO << "Index out of bounds" << index; |
| 23975 | return QPointF(); |
| 23976 | } |
| 23977 | } |
| 23978 | |
| 23979 | /* inherits documentation from base class */ |
| 23980 | void QCPBars::draw(QCPPainter *painter) |
no test coverage detected