! 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 */
| 10911 | \see pixelsToCoords, QCPAxis::coordToPixel |
| 10912 | */ |
| 10913 | void QCPAbstractPlottable::coordsToPixels(double key, double value, double &x, double &y) const |
| 10914 | { |
| 10915 | QCPAxis *keyAxis = mKeyAxis.data(); |
| 10916 | QCPAxis *valueAxis = mValueAxis.data(); |
| 10917 | if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return; } |
| 10918 | |
| 10919 | if (keyAxis->orientation() == Qt::Horizontal) |
| 10920 | { |
| 10921 | x = keyAxis->coordToPixel(key); |
| 10922 | y = valueAxis->coordToPixel(value); |
| 10923 | } else |
| 10924 | { |
| 10925 | y = keyAxis->coordToPixel(key); |
| 10926 | x = valueAxis->coordToPixel(value); |
| 10927 | } |
| 10928 | } |
| 10929 | |
| 10930 | /*! \overload |
| 10931 |
nothing calls this directly
no test coverage detected