! \internal Finds the smallest index of \a data, whose points y value is just above \a y. Assumes y values in \a data points are ordered ascending, as is ensured by \ref getLines/\ref getScatters if the key axis is vertical. Used to calculate the channel fill polygon, see \ref getChannelFillPolygon. */
| 21604 | Used to calculate the channel fill polygon, see \ref getChannelFillPolygon. |
| 21605 | */ |
| 21606 | int QCPGraph::findIndexAboveY(const QVector<QPointF> *data, double y) const |
| 21607 | { |
| 21608 | for (int i=data->size()-1; i>=0; --i) |
| 21609 | { |
| 21610 | if (data->at(i).y() < y) |
| 21611 | { |
| 21612 | if (i<data->size()-1) |
| 21613 | return i+1; |
| 21614 | else |
| 21615 | return data->size()-1; |
| 21616 | } |
| 21617 | } |
| 21618 | return -1; |
| 21619 | } |
| 21620 | |
| 21621 | /*! \internal |
| 21622 |