mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#779 Added support for filtering of zero and negative values in setSamplesFromDateAndValues
This commit is contained in:
@@ -377,13 +377,17 @@ void RimSummaryCurve::onLoadDataAndUpdate()
|
||||
std::vector<QDateTime> dateTimes;
|
||||
std::vector<double> values;
|
||||
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfType(plot);
|
||||
bool isLogCurve = plot->isLogarithmicScaleEnabled(this->associatedPlotAxis());
|
||||
|
||||
if(this->curveData(&dateTimes, &values))
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromDateAndValues(dateTimes, values);
|
||||
m_qwtPlotCurve->setSamplesFromDateAndValues(dateTimes, values, isLogCurve);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromDateAndValues(std::vector<QDateTime>(), std::vector<double>());
|
||||
m_qwtPlotCurve->setSamplesFromDateAndValues(std::vector<QDateTime>(), std::vector<double>(), isLogCurve);
|
||||
}
|
||||
|
||||
updateZoomInParentPlot();
|
||||
|
||||
@@ -125,6 +125,21 @@ void RimSummaryPlot::updateAxes()
|
||||
updateZoomInQwt();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimSummaryPlot::isLogarithmicScaleEnabled(RimDefines::PlotAxis plotAxis) const
|
||||
{
|
||||
if (plotAxis == RimDefines::PLOT_AXIS_LEFT)
|
||||
{
|
||||
return m_leftYAxisProperties->isLogarithmicScaleEnabled();
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_rightYAxisProperties->isLogarithmicScaleEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -72,6 +72,7 @@ public:
|
||||
void disableAutoZoom();
|
||||
|
||||
void updateAxes();
|
||||
bool isLogarithmicScaleEnabled(RimDefines::PlotAxis plotAxis) const;
|
||||
|
||||
protected:
|
||||
// Overridden PDM methods
|
||||
|
||||
Reference in New Issue
Block a user