* @brief Calculates the auto scale range of the multiplot. */
| 699 | * @brief Calculates the auto scale range of the multiplot. |
| 700 | */ |
| 701 | void Widgets::MultiPlot::calculateAutoScaleRange() |
| 702 | { |
| 703 | const auto prevMinY = m_minY; |
| 704 | const auto prevMaxY = m_maxY; |
| 705 | |
| 706 | if (m_data.isEmpty()) { |
| 707 | m_minY = 0; |
| 708 | m_maxY = 1; |
| 709 | } |
| 710 | |
| 711 | else if (!computeRangeFromDatasets()) { |
| 712 | scanCurvesForRange(); |
| 713 | padDerivedRange(); |
| 714 | } |
| 715 | |
| 716 | if (DSP::notEqual(prevMinY, m_minY) || DSP::notEqual(prevMaxY, m_maxY)) |
| 717 | Q_EMIT rangeChanged(); |
| 718 | } |
| 719 | |
| 720 | /** |
| 721 | * @brief Computes Y range from dataset pltMin/pltMax bounds. |