Skip to main content

Function: createHistogramBins()

createHistogramBins(values, numberOfBins): object

Defined in: packages/echarts/src/histogram/utils.ts:25

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