diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp index 8a80a77537..ca7ddd936f 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.cpp @@ -55,8 +55,11 @@ namespace caf template <> void caf::AppEnum::setUp() { - addItem( RimStatisticsPlot::HistogramFrequencyType::ABSOLUTE_FREQUENCY, "ABSOLUTE_FREQUENCY", "Absolute" ); - addItem( RimStatisticsPlot::HistogramFrequencyType::RELATIVE_FREQUENCY, "RELATIVE_FREQUENCY", "Relative" ); + addItem( RimStatisticsPlot::HistogramFrequencyType::ABSOLUTE_FREQUENCY, "ABSOLUTE_FREQUENCY", "Absolute Frequency" ); + addItem( RimStatisticsPlot::HistogramFrequencyType::RELATIVE_FREQUENCY, "RELATIVE_FREQUENCY", "Relative Frequency" ); + addItem( RimStatisticsPlot::HistogramFrequencyType::RELATIVE_FREQUENCY_PERCENT, + "RELATIVE_FREQUENCY_PERCENT", + "Relative Frequency [%]" ); setDefault( RimStatisticsPlot::HistogramFrequencyType::ABSOLUTE_FREQUENCY ); } } // namespace caf @@ -290,6 +293,8 @@ void RimStatisticsPlot::updatePlots() for ( double value : histogramData.histogram ) { if ( m_histogramFrequencyType() == HistogramFrequencyType::RELATIVE_FREQUENCY ) value /= sumElements; + if ( m_histogramFrequencyType() == HistogramFrequencyType::RELATIVE_FREQUENCY_PERCENT ) + value = value / sumElements * 100.0; *set0 << value; minValue = std::min( minValue, value ); maxValue = std::max( maxValue, value ); diff --git a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h index e0a58f7491..6de9a89081 100644 --- a/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h +++ b/ApplicationLibCode/ProjectDataModel/RimStatisticsPlot.h @@ -47,7 +47,8 @@ public: enum class HistogramFrequencyType { ABSOLUTE_FREQUENCY, - RELATIVE_FREQUENCY + RELATIVE_FREQUENCY, + RELATIVE_FREQUENCY_PERCENT }; RimStatisticsPlot();