Skip to content

Class QAccelPlot::HistogramFactory

ClassList > QAccelPlot > HistogramFactory

QML singleton Histogram that createsHistogram values from JavaScript arrays.More...

  • #include <HistogramFactory.hpp>

Inherits the following classes: QObject

Inheritance diagram

flowchart TB
  classQAccelPlot_1_1HistogramFactory["QAccelPlot::HistogramFactory"]

  external_base_classQAccelPlot_1_1HistogramFactory_1["QObject"]
  external_base_classQAccelPlot_1_1HistogramFactory_1 --> classQAccelPlot_1_1HistogramFactory

Public Functions

Type Name
HistogramFactory (QObject * parent=nullptr)
Constructs the factory with the given parent .
Q_INVOKABLE QList< qreal > decadeEdges (qreal min, qreal max) const
Returns the edges from min to__max at 1, 2, ..., 9 times each power of ten: the ticks of a logarithmic axis.
Q_INVOKABLE Histogram fromCounts (const QList< qreal > & edges, const QList< qreal > & counts) const
Wraps data that is already binned: counts has one value per bin between__edges .
Q_INVOKABLE Histogram fromSamples (const QList< qreal > & samples, const QVariant & bins) const
Counts samples into bins.
Q_INVOKABLE Histogram fromSamples (const QList< qreal > & samples, int binCount, qreal min, qreal max) const
Counts samples into__binCount equal bins from__min to__max .
Q_INVOKABLE QList< qreal > linearEdges (qreal min, qreal max, int binCount) const
Returns binCount + 1 equally spaced edges from__min to__max .
Q_INVOKABLE QList< qreal > logEdges (qreal min, qreal max, int binCount) const
Returns binCount + 1 edges from__min to__max , equally spaced on a logarithmic axis.

Detailed Description

** **

import QAccelPlot as QAccelPlot

QAccelPlot.BarSeries {
    Component.onCompleted: setData(QAccelPlot.Histogram.fromSamples(samples, 40).bars())
}

C++ code uses the static functions of Histogram instead.

See also: Histogram

Public Functions Documentation

function HistogramFactory

Constructs the factory with the given parent .

explicit QAccelPlot::HistogramFactory::HistogramFactory (
    QObject * parent=nullptr
) 


function decadeEdges

Returns the edges from min to__max at 1, 2, ..., 9 times each power of ten: the ticks of a logarithmic axis.

Q_INVOKABLE QList< qreal > QAccelPlot::HistogramFactory::decadeEdges (
    qreal min,
    qreal max
) const


function fromCounts

Wraps data that is already binned: counts has one value per bin between__edges .

Q_INVOKABLE Histogram QAccelPlot::HistogramFactory::fromCounts (
    const QList< qreal > & edges,
    const QList< qreal > & counts
) const


function fromSamples

Counts samples into bins.

Q_INVOKABLE Histogram QAccelPlot::HistogramFactory::fromSamples (
    const QList< qreal > & samples,
    const QVariant & bins
) const

bins is either a number of equal bins spanning the finite samples, or a list of finite, strictly increasing edges.


function fromSamples

Counts samples into__binCount equal bins from__min to__max .

Q_INVOKABLE Histogram QAccelPlot::HistogramFactory::fromSamples (
    const QList< qreal > & samples,
    int binCount,
    qreal min,
    qreal max
) const


function linearEdges

Returns binCount + 1 equally spaced edges from__min to__max .

Q_INVOKABLE QList< qreal > QAccelPlot::HistogramFactory::linearEdges (
    qreal min,
    qreal max,
    int binCount
) const


function logEdges

Returns binCount + 1 edges from__min to__max , equally spaced on a logarithmic axis.

Q_INVOKABLE QList< qreal > QAccelPlot::HistogramFactory::logEdges (
    qreal min,
    qreal max,
    int binCount
) const



The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/data/HistogramFactory.hpp