mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5234 Fix auto scale of cross plot x-axis
* The issue is that the bottom axis is really a QwtDateScaleEngine as opposed to a QwtLinearScaleEngine. * This may have worked before by "accident" before the changes to the date format on the date/time axis. * The fix is that if we want a QwtLinearScaleEngine and have a QwtDateScaleEngine we replace the scale engine.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "RiuSummaryQuantityNameInfoProvider.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
|
||||
#include "qwt_date_scale_engine.h"
|
||||
#include "qwt_plot_curve.h"
|
||||
#include "qwt_scale_draw.h"
|
||||
#include "qwt_scale_engine.h"
|
||||
@@ -168,7 +169,8 @@ void RimSummaryPlotAxisFormatter::applyAxisPropertiesToPlot( RiuSummaryQwtPlot*
|
||||
{
|
||||
QwtLinearScaleEngine* currentScaleEngine = dynamic_cast<QwtLinearScaleEngine*>(
|
||||
qwtPlot->axisScaleEngine( m_axisProperties->qwtPlotAxisType() ) );
|
||||
if ( !currentScaleEngine )
|
||||
QwtDateScaleEngine* dateScaleEngine = dynamic_cast<QwtDateScaleEngine*>( currentScaleEngine );
|
||||
if ( !currentScaleEngine || dateScaleEngine )
|
||||
{
|
||||
qwtPlot->setAxisScaleEngine( m_axisProperties->qwtPlotAxisType(), new QwtLinearScaleEngine );
|
||||
qwtPlot->setAxisMaxMinor( m_axisProperties->qwtPlotAxisType(), 3 );
|
||||
|
||||
Reference in New Issue
Block a user