! \internal Finds the smallest index of \a data, whose points x value is just above \a x. Assumes x values in \a data points are ordered ascending, as is ensured by \ref getLines/\ref getScatters if the key axis is horizontal. Used to calculate the channel fill polygon, see \ref getChannelFillPolygon. */
| 21558 | Used to calculate the channel fill polygon, see \ref getChannelFillPolygon. |
| 21559 | */ |
| 21560 | int QCPGraph::findIndexAboveX(const QVector<QPointF> *data, double x) const |
| 21561 | { |
| 21562 | for (int i=data->size()-1; i>=0; --i) |
| 21563 | { |
| 21564 | if (data->at(i).x() < x) |
| 21565 | { |
| 21566 | if (i<data->size()-1) |
| 21567 | return i+1; |
| 21568 | else |
| 21569 | return data->size()-1; |
| 21570 | } |
| 21571 | } |
| 21572 | return -1; |
| 21573 | } |
| 21574 | |
| 21575 | /*! \internal |
| 21576 |