QGIS API Documentation
4.3.0-Master (6ece89243d2)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgshistogram.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgshistogram.h
3
--------------
4
begin : May 2015
5
copyright : (C) 2015 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSHISTOGRAM_H
19
#define QGSHISTOGRAM_H
20
21
#include "qgis_core.h"
22
#include "
qgsfeedback.h
"
23
24
#include <QList>
25
26
class
QgsVectorLayer
;
27
28
35
36
class
CORE_EXPORT
QgsHistogram
37
{
38
public
:
39
QgsHistogram
() =
default
;
40
41
virtual
~QgsHistogram
() =
default
;
42
47
void
setValues
(
const
QList<double> &values );
48
57
bool
setValues
(
const
QgsVectorLayer
*layer,
const
QString &fieldOrExpression,
QgsFeedback
*feedback =
nullptr
);
58
66
double
optimalBinWidth
()
const
;
67
76
int
optimalNumberBins
()
const
;
77
85
QList<double>
binEdges
(
int
bins )
const
;
86
93
QList<int>
counts
(
int
bins )
const
;
94
95
private
:
96
QList<double> mValues;
97
double
mMax = 0;
98
double
mMin = 0;
99
double
mIQR = 0;
100
101
void
prepareValues();
102
};
103
104
#endif
// QGSHISTOGRAM_H
QgsFeedback
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Definition
qgsfeedback.h:44
QgsHistogram::QgsHistogram
QgsHistogram()=default
QgsHistogram::counts
QList< int > counts(int bins) const
Returns the calculated list of the counts for the histogram bins.
Definition
qgshistogram.cpp:84
QgsHistogram::optimalNumberBins
int optimalNumberBins() const
Returns the optimal number of bins for the source values, calculated using the Freedman-Diaconis rule...
Definition
qgshistogram.cpp:63
QgsHistogram::optimalBinWidth
double optimalBinWidth() const
Calculates the optimal bin width using the Freedman-Diaconis rule.
Definition
qgshistogram.cpp:57
QgsHistogram::binEdges
QList< double > binEdges(int bins) const
Returns a list of edges for the histogram for a specified number of bins.
Definition
qgshistogram.cpp:68
QgsHistogram::~QgsHistogram
virtual ~QgsHistogram()=default
QgsHistogram::setValues
void setValues(const QList< double > &values)
Assigns numeric source values for the histogram.
Definition
qgshistogram.cpp:36
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgsfeedback.h
Generated on
for QGIS API Documentation by
1.17.0