getHistogram
A Histogram model is a data model that represents a list of labeled data points for bins (ranges) of data, defined as ticks over a numerical range, Suitable for histogram charts.
Usage
Options
The getHistogram
model inherits all options from the base options, plus:
column: the name of the column that you will run the statistical operation on. It also accepts the
*
value, that willticks: the list of numerical upper bound thresholds that will be used to create the bins. There's no maximum number of ticks.
operation: the aggregation that will be performed on the
column
for each range bin. Accepted values are:count
avg
min
max
sum
Response
An ordered array containing the value for each histogram bin.
Please note that the response always contain one additional row compared to the amount of ticks specified in the options. This is because ticks are the upper bound threshold, and there needs to be an additional bucket for values above the last tick.
The response can be then mapped to any HTML element, but commonly it will be mapped to a a charting library to create histogram charts.
Last updated