mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Multiaxis: add support for Qwt multiaxis plot
This commit is contained in:
committed by
Kristian Bendiksen
parent
22d6e3f853
commit
dde0487024
@@ -20,6 +20,7 @@
|
||||
#include "RiaDateTimeDefines.h"
|
||||
#include "RiaPlotDefines.h"
|
||||
|
||||
#include <qwt_axis_id.h>
|
||||
#include <qwt_date.h>
|
||||
#include <qwt_plot.h>
|
||||
#include <qwt_plot_shapeitem.h>
|
||||
@@ -27,6 +28,8 @@
|
||||
class RiuQwtPlotLegend;
|
||||
class RimPlotCurve;
|
||||
|
||||
class RiuPlotAxis;
|
||||
|
||||
class RiuQwtPlotTools
|
||||
{
|
||||
public:
|
||||
@@ -62,11 +65,13 @@ public:
|
||||
QColor color,
|
||||
Qt::BrushStyle brushStyle = Qt::SolidPattern );
|
||||
|
||||
static QwtPlot::Axis toQwtPlotAxis( RiaDefines::PlotAxis );
|
||||
static RiaDefines::PlotAxis fromQwtPlotAxis( QwtPlot::Axis );
|
||||
|
||||
static void updateLegendData( RiuQwtPlotLegend* legend, const std::vector<RimPlotCurve*>& curves );
|
||||
static QList<QwtLegendData> createLegendData( const std::vector<RimPlotCurve*>& curves );
|
||||
static QwtAxisId toQwtPlotAxis( RiuPlotAxis riuPlotAxis );
|
||||
static QwtAxis::Position toQwtPlotAxisEnum( RiaDefines::PlotAxis riaPlotAxis );
|
||||
|
||||
static RiaDefines::PlotAxis fromQwtPlotAxis( QwtAxis::Position );
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -90,7 +95,7 @@ PlotShapeItemType* RiuQwtPlotTools::createBoxShapeT( const QString& label,
|
||||
polygon.push_back( QPointF( startX, endY ) );
|
||||
polygon.push_back( QPointF( startX, startY ) );
|
||||
columnShape->setPolygon( polygon );
|
||||
columnShape->setXAxis( QwtPlot::xBottom );
|
||||
columnShape->setXAxis( QwtAxis::XBottom );
|
||||
columnShape->setBrush( QBrush( color, brushStyle ) );
|
||||
columnShape->setLegendMode( QwtPlotShapeItem::LegendShape );
|
||||
columnShape->setLegendIconSize( QSize( 16, 16 ) );
|
||||
|
||||
Reference in New Issue
Block a user