mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merge pull request #8387 from OPM/qtcharts-summary-plots
Closes #8228 Major refactoring of summary plotting. Now possible to create plots both with Qwt and QtChart as plotting tool.
This commit is contained in:
committed by
GitHub
parent
d9bb82de91
commit
258fbddc10
@@ -378,7 +378,7 @@ void RimGridTimeHistoryCurve::updateZoomInParentPlot()
|
||||
RimSummaryPlot* plot = nullptr;
|
||||
firstAncestorOrThisOfType( plot );
|
||||
|
||||
plot->updateZoomInQwt();
|
||||
plot->updateZoomInParentPlot();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -415,11 +415,11 @@ void RimGridTimeHistoryCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
std::vector<time_t> dateTimes = timeStepValues();
|
||||
if ( dateTimes.size() > 0 && dateTimes.size() == values.size() )
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromTimeTAndYValues( dateTimes, values, isLogCurve );
|
||||
m_plotCurve->setSamplesFromTimeTAndYValues( dateTimes, values, isLogCurve );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromTimeTAndYValues( std::vector<time_t>(), std::vector<double>(), isLogCurve );
|
||||
m_plotCurve->setSamplesFromTimeTAndYValues( std::vector<time_t>(), std::vector<double>(), isLogCurve );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -435,17 +435,17 @@ void RimGridTimeHistoryCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
times.push_back( timeScale * day );
|
||||
}
|
||||
|
||||
m_qwtPlotCurve->setSamplesFromXValuesAndYValues( times, values, isLogCurve );
|
||||
m_plotCurve->setSamplesFromXValuesAndYValues( times, values, isLogCurve );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setSamplesFromTimeTAndYValues( std::vector<time_t>(), std::vector<double>(), isLogCurve );
|
||||
m_plotCurve->setSamplesFromTimeTAndYValues( std::vector<time_t>(), std::vector<double>(), isLogCurve );
|
||||
}
|
||||
}
|
||||
|
||||
updateZoomInParentPlot();
|
||||
|
||||
if ( m_parentQwtPlot ) m_parentQwtPlot->replot();
|
||||
if ( m_parentPlot ) m_parentPlot->replot();
|
||||
|
||||
updateQwtPlotAxis();
|
||||
plot->updateAxes();
|
||||
@@ -708,17 +708,7 @@ QString RimGridTimeHistoryCurve::geometrySelectionText() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridTimeHistoryCurve::updateQwtPlotAxis()
|
||||
{
|
||||
if ( m_qwtPlotCurve )
|
||||
{
|
||||
if ( this->yAxis() == RiaDefines::PlotAxis::PLOT_AXIS_LEFT )
|
||||
{
|
||||
m_qwtPlotCurve->setYAxis( QwtPlot::yLeft );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_qwtPlotCurve->setYAxis( QwtPlot::yRight );
|
||||
}
|
||||
}
|
||||
if ( m_plotCurve ) updateAxisInPlot( yAxis() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user