Skip to content
Permalink
Browse files

do not limit the number of classes in logarithmic method (#33223)

this was preventing from setting enough classes
  • Loading branch information
3nids authored and nyalldawson committed Dec 4, 2019
1 parent 30609fe commit 8fdb992970f7cae5230c0896272ad1a285f31c24
Showing with 4 additions and 7 deletions.
  1. +4 −7 src/core/classification/qgsclassificationlogarithmic.cpp
@@ -48,17 +48,14 @@ QIcon QgsClassificationLogarithmic::icon() const

QList<double> QgsClassificationLogarithmic::calculateBreaks( double minimum, double maximum, const QList<double> &values, int nclasses )
{
Q_UNUSED( values );
Q_UNUSED( values )

// get the min/max in log10 scale
int lmin = std::floor( std::log10( minimum ) );
int lmax = std::ceil( std::log10( maximum ) );

// do not create too many classes
nclasses = std::min( lmax - lmin + 1, nclasses );
double log_min = std::floor( std::log10( minimum ) );
double log_max = std::ceil( std::log10( maximum ) );

// calculate pretty breaks
QList<double> breaks = QgsSymbolLayerUtils::prettyBreaks( lmin, lmax, nclasses );
QList<double> breaks = QgsSymbolLayerUtils::prettyBreaks( log_min, log_max, nclasses );

// create the value
for ( int i = 0; i < breaks.count(); i++ )

0 comments on commit 8fdb992

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