linearBins() function

The linearBins() function generates a list of linearly separated floats. It is a helper function meant to generate bin bounds for the histogram() function.

Function type: Miscellaneous
Output data type: Array of floats

linearBins(start: 0.0, width: 5.0, count: 20, infinity: true)



The first value in the returned list.

Data type: Float


The distance between subsequent bin values.

Data type: Float


The number of bins to create.

Data type: Integer


When true, adds an additional bin with a value of positive infinity. Defaults to true.

Data type: Boolean


linearBins(start: 0.0, width: 10.0, count: 10)

// Generated list: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, +Inf]

New! Cloud or OSS?

InfluxDB OSS 2.0 release candidate

InfluxDB OSS v2.0.rc includes breaking changes that require a manual upgrade from all alpha and beta versions. For information, see:

Upgrade to InfluxDB OSS v2.0.rc