Skip to content

grafit-charts


Interface: HistogramSeriesOptions

Extends

Properties

aggregation?

optional aggregation?: "count" | "sum" | "mean"


binCount?

optional binCount?: number | BinRule

Number of bins, or the rule that picks it. Default 'auto'.

Inherited from

BinningOptions.binCount


binInclusive?

optional binInclusive?: BinInclusive

'left' — [x0, x1), the last bin closed; 'right' — (x0, x1], the first one closed.

Inherited from

BinningOptions.binInclusive


binOrigin?

optional binOrigin?: number

Value the grid is aligned to (default 0): edges fall on binOrigin + k·width.

Inherited from

BinningOptions.binOrigin


bins?

optional bins?: [number, number][]

Explicit edges: [[min,max], ...]. Wins over every other option here.

Inherited from

BinningOptions.bins


binWidth?

optional binWidth?: number | TimeBinUnit

Bin width. Wins over binCount: the step is the intent, the count follows. A calendar unit ('month', 'week', …) bins dates instead of numbers — the values are read as dates and the grid is aligned in UTC, where the ticks of the time axis are.

Inherited from

BinningOptions.binWidth


domain?

optional domain?: [number, number]

Range to bin; values outside it are ruled by outliers. Default — the data extent.

Inherited from

BinningOptions.domain


fill?

optional fill?: string


fillOpacity?

optional fillOpacity?: number


fills?

optional fills?: string[]

Colours of the groups; without it — the theme palette.


groupField?

optional groupField?: string

Field that splits the data into distributions of its own, one colour each.


groupGap?

optional groupGap?: number

Gap between side-by-side bars of one bin, as a fraction of a slot (groupMode: 'grouped').


groupMode?

optional groupMode?: HistogramGroupMode

How those distributions share a bin (default 'stacked').


id?

optional id?: string

Inherited from

LineSeriesOptions.id


label?

optional label?: Switchable & FontOptions & LabelOverlapOptions & object

Value labels: same placements as bar (top, inner-top, center, …).

Type Declaration

formatter?

optional formatter?: (params) => string

Parameters
params
count

number

group?

unknown

The value of groupField this bar belongs to; undefined without grouping.

raw

number

value

number

x0

number

x1

number

Returns

string

placement?

optional placement?: RectLabelPlacement


name?

optional name?: string


nice?

optional nice?: boolean

Round the computed step to 1/2/5×10ⁿ (default true; ignored with binWidth).

Inherited from

BinningOptions.nice


normalize?

optional normalize?: HistogramNormalize

What a bar's height stands for: the value itself, a share, a density, a running total.


normalizeWithin?

optional normalizeWithin?: HistogramNormalizeWithin

Whose total a share is measured against: the whole chart or each group.


outliers?

optional outliers?: BinOutliers

Values outside domain: dropped (default) or piled into the edge bins.

Inherited from

BinningOptions.outliers


showInLegend?

optional showInLegend?: boolean

Inherited from

LineSeriesOptions.showInLegend


stroke?

optional stroke?: string


strokeWidth?

optional strokeWidth?: number


tooltip?

optional tooltip?: Switchable & object

Type Declaration

renderer?

optional renderer?: (params) => string | TooltipContentData

Parameters
params

HistogramTooltipRendererParams

Returns

string | TooltipContentData

Inherited from

Omit.tooltip


type

type: "histogram"


visible?

optional visible?: boolean

Inherited from

Showable.visible


xField

xField: string

Numeric field used to build the bins.

Overrides

LineSeriesOptions.xField


xName?

optional xName?: string

Inherited from

LineSeriesOptions.xName


yField?

optional yField?: string

Aggregation field; without it the count is used.