mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Release 2023.06
This commit is contained in:
@@ -353,9 +353,10 @@ void RiuGroupedBarChartBuilder::addBarEntry( const QString& majorTickText,
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuGroupedBarChartBuilder::setLegendColorMap( const std::map<QString, QColor>& legendColors )
|
||||
void RiuGroupedBarChartBuilder::setBarColor( const QColor& color )
|
||||
{
|
||||
m_legendColors = legendColors;
|
||||
m_useBarColor = true;
|
||||
m_barColor = color;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -654,15 +655,11 @@ void RiuGroupedBarChartBuilder::addBarChartToPlot( QwtPlot* plot, Qt::Orientatio
|
||||
int idx = 0;
|
||||
for ( const auto& legendToBarPointsPair : legendToBarPointsMap )
|
||||
{
|
||||
QColor legendColor = RiaColorTables::categoryPaletteColors().cycledQColor( idx );
|
||||
QColor color = RiaColorTables::categoryPaletteColors().cycledQColor( idx );
|
||||
|
||||
auto legendColorPairIt = m_legendColors.find( legendToBarPointsPair.first );
|
||||
if ( legendColorPairIt != m_legendColors.end() )
|
||||
{
|
||||
legendColor = legendColorPairIt->second;
|
||||
}
|
||||
if ( m_useBarColor ) color = m_barColor;
|
||||
|
||||
addQwtBarChart( plot, legendToBarPointsPair.second, legendToBarPointsPair.first, legendColor, barOrientation );
|
||||
addQwtBarChart( plot, legendToBarPointsPair.second, legendToBarPointsPair.first, color, barOrientation );
|
||||
idx++;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QColor>
|
||||
#include <QPointF>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
@@ -27,7 +28,6 @@
|
||||
#include <set>
|
||||
|
||||
class QwtPlot;
|
||||
class QColor;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
const QString& barText,
|
||||
const double value );
|
||||
|
||||
void setLegendColorMap( const std::map<QString, QColor>& legendColors );
|
||||
void setBarColor( const QColor& color );
|
||||
|
||||
void addBarChartToPlot( QwtPlot* plot, Qt::Orientation orientation, int maxBarCount = -1 );
|
||||
void setLabelFontSize( int labelPointSize );
|
||||
@@ -85,9 +85,10 @@ private:
|
||||
bool operator<( const BarEntry& other ) const;
|
||||
};
|
||||
|
||||
std::multiset<BarEntry> m_sortedBarEntries;
|
||||
Qt::Orientation m_orientation;
|
||||
std::map<QString, QColor> m_legendColors;
|
||||
bool m_isSortingByMaxValueInGroups;
|
||||
int m_labelPointSize;
|
||||
std::multiset<BarEntry> m_sortedBarEntries;
|
||||
bool m_isSortingByMaxValueInGroups;
|
||||
int m_labelPointSize;
|
||||
|
||||
bool m_useBarColor = false;
|
||||
QColor m_barColor;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user