#7712 Statistics Plot: replace "Bar Width" with "Gap Width"

Also changed range from fraction to percentage, and inverted logic.
This commit is contained in:
Kristian Bendiksen 2021-05-28 14:08:19 +02:00 committed by Magne Sjaastad
parent 429d1e4166
commit ae2af64c24
2 changed files with 7 additions and 7 deletions

View File

@ -76,8 +76,8 @@ RimStatisticsPlot::RimStatisticsPlot()
CAF_PDM_InitField( &m_histogramBarColor, "HistogramBarColor", cvf::Color3f( cvf::Color3f::SKY_BLUE ), "Bar Color", "", "", "" );
CAF_PDM_InitField( &m_histogramBarWidth, "HistogramBarWidth", 1.0, "Bar Width", "", "", "" );
m_histogramBarWidth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
CAF_PDM_InitField( &m_histogramGapWidth, "HistogramGapWidth", 0.0, "Gap Width [%]", "", "", "" );
m_histogramGapWidth.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_histogramFrequencyType, "HistogramFrequencyType", "Frequency", "", "", "" );
@ -215,10 +215,10 @@ void RimStatisticsPlot::defineEditorAttribute( const caf::PdmFieldHandle* field,
}
caf::PdmUiDoubleSliderEditorAttribute* sliderAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>( attribute );
if ( field == &m_histogramBarWidth && sliderAttr != nullptr )
if ( field == &m_histogramGapWidth && sliderAttr != nullptr )
{
sliderAttr->m_minimum = 0.0;
sliderAttr->m_maximum = 1.0;
sliderAttr->m_maximum = 100.0;
}
}
@ -230,7 +230,7 @@ void RimStatisticsPlot::uiOrderingForHistogram( QString uiConfigName, caf::PdmUi
caf::PdmUiGroup* histogramGroup = uiOrdering.addNewGroup( "Histogram" );
if ( showHistogramBins ) histogramGroup->add( &m_numHistogramBins );
histogramGroup->add( &m_histogramBarColor );
histogramGroup->add( &m_histogramBarWidth );
histogramGroup->add( &m_histogramGapWidth );
histogramGroup->add( &m_histogramFrequencyType );
}
@ -274,7 +274,7 @@ void RimStatisticsPlot::updatePlots()
set0->setColor( RiaColorTools::toQColor( m_histogramBarColor ) );
QBarSeries* series = new QBarSeries();
series->setBarWidth( m_histogramBarWidth() );
series->setBarWidth( ( 100.0 - m_histogramGapWidth() ) / 100.0 );
series->append( set0 );
QChart* chart = new QChart();

View File

@ -92,6 +92,6 @@ protected:
caf::PdmField<QString> m_plotWindowTitle;
caf::PdmField<int> m_numHistogramBins;
caf::PdmField<cvf::Color3f> m_histogramBarColor;
caf::PdmField<double> m_histogramBarWidth;
caf::PdmField<double> m_histogramGapWidth;
caf::PdmField<caf::AppEnum<HistogramFrequencyType>> m_histogramFrequencyType;
};