Release 2023.06

This commit is contained in:
Magne Sjaastad
2023-06-19 13:48:44 +02:00
committed by GitHub
parent a7108f0a09
commit 77bf792b1a
1390 changed files with 66974 additions and 11511 deletions

View File

@@ -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++;
}

View File

@@ -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;
};