Skip to content
Permalink
Browse files

Save scale by area/diameter setting

  • Loading branch information
m-kuhn committed Aug 10, 2012
1 parent 468650b commit e0e5f1a9531f8b17da1e3371e2e16b7f5e6a8608
Showing with 30 additions and 2 deletions.
  1. +9 −0 src/app/qgsvectorlayerproperties.cpp
  2. +21 −2 src/core/qgsdiagramrendererv2.cpp
@@ -1810,6 +1810,15 @@ void QgsVectorLayerProperties::initDiagramTab()
mIncreaseSmallDiagramsCheckBox->setChecked( settingList.at( 0 ).minimumSize != 0 );
mIncreaseMinimumSizeSpinBox->setValue( settingList.at( 0 ).minimumSize );

if ( settingList.at( 0 ).scaleByArea )
{
mScaleDependencyComboBox->setCurrentIndex( 0 );
}
else
{
mScaleDependencyComboBox->setCurrentIndex( 1 );
}

QList< QColor > categoryColors = settingList.at( 0 ).categoryColors;
QList< int > categoryIndices = settingList.at( 0 ).categoryIndices;
QList< int >::const_iterator catIt = categoryIndices.constBegin();
@@ -95,6 +95,16 @@ void QgsDiagramSettings::readXML( const QDomElement& elem )
diagramOrientation = Up;
}

// scale dependency
if ( elem.attribute( "scaleDependency" ) == "Diameter" )
{
scaleByArea = false;
}
else
{
scaleByArea = true;
}

barWidth = elem.attribute( "barWidth" ).toDouble();

minimumSize = elem.attribute( "minimumSize" ).toDouble();
@@ -144,11 +154,20 @@ void QgsDiagramSettings::writeXML( QDomElement& rendererElem, QDomDocument& doc
// label placement method (text diagram)
if ( labelPlacementMethod == Height )
{
categoryElem.setAttribute( "labelPlacementMethod", "Height" );
categoryElem.setAttribute( "labelPlacementMethod", "Height" );
}
else
{
categoryElem.setAttribute( "labelPlacementMethod", "XHeight" );
}

if ( scaleByArea )
{
categoryElem.setAttribute( "scaleDependency", "Area" );
}
else
{
categoryElem.setAttribute( "labelPlacementMethod", "XHeight" );
categoryElem.setAttribute( "scaleDependency", "Diameter" );
}

// orientation (histogram)

0 comments on commit e0e5f1a

Please sign in to comment.
You can’t perform that action at this time.