Skip to content

Documentation v1.0.0


Documentation / @openassistant/plots / createHistogramBins

Function: createHistogramBins() ​

createHistogramBins(values, numberOfBins): object

Defined in: echarts/histogram/utils.ts:28

Create histogram bins.

Parameters ​

values ​

(string | number)[]

The values of the variable (can be numbers or strings).

numberOfBins ​

number = 5

The number of bins to create (only used for numeric values).

Returns ​

object

The histogram bins.

barDataIndexes ​

barDataIndexes: number[][]

breaks ​

breaks: number[]

counts ​

counts: number[]

histogramData ​

histogramData: HistogramDataProps[]

indices ​

indices: number[][]

Throws ​

Error if the number of unique string values exceeds 20

Released under the MIT License.