! \internal Finds the highest index of \a data, whose points x value is just below \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. */
| 21581 | Used to calculate the channel fill polygon, see \ref getChannelFillPolygon. |
| 21582 | */ |
| 21583 | int QCPGraph::findIndexBelowX(const QVector<QPointF> *data, double x) const |
| 21584 | { |
| 21585 | for (int i=0; i<data->size(); ++i) |
| 21586 | { |
| 21587 | if (data->at(i).x() > x) |
| 21588 | { |
| 21589 | if (i>0) |
| 21590 | return i-1; |
| 21591 | else |
| 21592 | return 0; |
| 21593 | } |
| 21594 | } |
| 21595 | return -1; |
| 21596 | } |
| 21597 | |
| 21598 | /*! \internal |
| 21599 |