mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
115 lines
3.3 KiB
Plaintext
115 lines
3.3 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgshistogram.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsHistogram
|
|
{
|
|
%Docstring(signature="appended")
|
|
Calculator for a numeric histogram from a list of values.
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgshistogram.h"
|
|
%End
|
|
public:
|
|
|
|
QgsHistogram();
|
|
|
|
virtual ~QgsHistogram();
|
|
|
|
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 cancellation of calculation
|
|
|
|
:return: ``True`` if values were successfully set
|
|
%End
|
|
|
|
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:: :py:func:`optimalNumberBins`
|
|
|
|
.. note::
|
|
|
|
values must first be specified using :py:func:`~QgsHistogram.setValues`
|
|
%End
|
|
|
|
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:: :py:func:`optimalBinWidth`
|
|
|
|
.. note::
|
|
|
|
values must first be specified using :py:func:`~QgsHistogram.setValues`
|
|
%End
|
|
|
|
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 :py:func:`~QgsHistogram.setValues`
|
|
%End
|
|
|
|
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 :py:func:`~QgsHistogram.setValues`
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgshistogram.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.py again *
|
|
************************************************************************/
|