Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Sypify core.QgsHistogram
- Loading branch information
1 parent
8e61d48
commit 264c902
Showing
2 changed files
with
80 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,106 @@ | ||
/** \ingroup core | ||
* \class QgsHistogram | ||
* \brief Calculator for a numeric histogram from a list of values. | ||
* | ||
* \note Added in version 2.9 | ||
*/ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/qgshistogram.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
class QgsHistogram | ||
{ | ||
%Docstring | ||
Calculator for a numeric histogram from a list of values. | ||
|
||
.. versionadded:: 2.9 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgshistogram.h" | ||
%End | ||
|
||
public: | ||
|
||
QgsHistogram(); | ||
|
||
virtual ~QgsHistogram(); | ||
|
||
/** Assigns numeric source values for the histogram. | ||
* @param values list of doubles | ||
*/ | ||
void setValues( const QList<double> &values ); | ||
%Docstring | ||
Assigns numeric source values for the histogram. | ||
\param values list of doubles | ||
%End | ||
|
||
bool setValues( const QgsVectorLayer *layer, const QString &fieldOrExpression, QgsFeedback *feedback = 0 ); | ||
%Docstring | ||
Assigns numeric source values for the histogram from a vector layer's field or as the | ||
result of an expression. | ||
\param layer vector layer | ||
\param fieldOrExpression field name or expression to be evaluated | ||
\param feedback optional feedback object to allow cancelation of calculation | ||
:return: true if values were successfully set | ||
:rtype: bool | ||
%End | ||
|
||
/** Calculates the optimal bin width using the Freedman-Diaconis rule. Bins widths are | ||
* determined by the inter-quartile range of values and the number of values. | ||
* @returns optimal width for bins | ||
* @see optimalNumberBins | ||
* @note values must first be specified using @link setValues @endlink | ||
*/ | ||
double optimalBinWidth() const; | ||
%Docstring | ||
Calculates the optimal bin width using the Freedman-Diaconis rule. Bins widths are | ||
determined by the inter-quartile range of values and the number of values. | ||
:return: optimal width for bins | ||
.. seealso:: optimalNumberBins | ||
.. note:: | ||
|
||
values must first be specified using setValues() | ||
:rtype: float | ||
%End | ||
|
||
/** Returns the optimal number of bins for the source values, calculated using the | ||
* Freedman-Diaconis rule. The number of bins are determined by the inter-quartile range | ||
* of values and the number of values. | ||
* @returns optimal number of bins | ||
* @see optimalBinWidth | ||
* @note values must first be specified using @link setValues @endlink | ||
*/ | ||
int optimalNumberBins() const; | ||
%Docstring | ||
Returns the optimal number of bins for the source values, calculated using the | ||
Freedman-Diaconis rule. The number of bins are determined by the inter-quartile range | ||
of values and the number of values. | ||
:return: optimal number of bins | ||
.. seealso:: optimalBinWidth | ||
.. note:: | ||
|
||
values must first be specified using setValues() | ||
:rtype: int | ||
%End | ||
|
||
/** Returns a list of edges for the histogram for a specified number of bins. This list | ||
* will be length bins + 1, as both the first and last value are also included. | ||
* @param bins number of bins | ||
* @return list of bin edges | ||
* @note values must first be specified using @link setValues @endlink | ||
*/ | ||
QList<double> binEdges( int bins ) const; | ||
%Docstring | ||
Returns a list of edges for the histogram for a specified number of bins. This list | ||
will be length bins + 1, as both the first and last value are also included. | ||
\param bins number of bins | ||
:return: list of bin edges | ||
.. note:: | ||
|
||
values must first be specified using setValues() | ||
:rtype: list of float | ||
%End | ||
|
||
/** Returns the calculated list of the counts for the histogram bins. | ||
* @param bins number of histogram bins | ||
* @return list of histogram counts | ||
* @note values must first be specified using @link setValues @endlink | ||
*/ | ||
QList<int> counts( int bins ) const; | ||
%Docstring | ||
Returns the calculated list of the counts for the histogram bins. | ||
\param bins number of histogram bins | ||
:return: list of histogram counts | ||
.. note:: | ||
|
||
values must first be specified using setValues() | ||
:rtype: list of int | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/qgshistogram.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |