! Convenience function for transforming a key/value pair to pixels on the QCustomPlot surface, taking the orientations of the axes associated with this plottable into account (e.g. whether key represents x or y). \a key and \a value are transformed to the coodinates in pixels and are written to \a x and \a y. \see pixelsToCoords, QCPAxis::coordToPixel */
| 11627 | \see pixelsToCoords, QCPAxis::coordToPixel |
| 11628 | */ |
| 11629 | void QCPAbstractPlottable::coordsToPixels(double key, double value, double &x, double &y) const |
| 11630 | { |
| 11631 | QCPAxis *keyAxis = mKeyAxis.data(); |
| 11632 | QCPAxis *valueAxis = mValueAxis.data(); |
| 11633 | if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return; } |
| 11634 | |
| 11635 | if (keyAxis->orientation() == Qt::Horizontal) |
| 11636 | { |
| 11637 | x = keyAxis->coordToPixel(key); |
| 11638 | y = valueAxis->coordToPixel(value); |
| 11639 | } else |
| 11640 | { |
| 11641 | y = keyAxis->coordToPixel(key); |
| 11642 | x = valueAxis->coordToPixel(value); |
| 11643 | } |
| 11644 | } |
| 11645 | |
| 11646 | /*! \overload |
| 11647 |
nothing calls this directly
no test coverage detected