#779 Added support for filtering of zero and negative values in setSamplesFromDateAndValues

This commit is contained in:
Magne Sjaastad
2016-10-12 13:49:57 +02:00
parent ee367487de
commit ae1eea4ac6
10 changed files with 44 additions and 14 deletions

View File

@@ -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();

View File

@@ -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();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -72,6 +72,7 @@ public:
void disableAutoZoom();
void updateAxes();
bool isLogarithmicScaleEnabled(RimDefines::PlotAxis plotAxis) const;
protected:
// Overridden PDM methods