binWidth Function (GPL)

Syntax

binWidth(<numeric> ...)

<numeric>. A positive numeric value indicating the width of the bins. If the data being binned are dates, the value indicates days or seconds, depending on the underlying data. To specify an explicit unit, append d or s to the value to indicate days or seconds, respectively. If there are multiple binned dimensions, you can specify the bin width for each dimension. Use commas to separate the multiple widths. For example, binWidth(100,200) specifies 100 as the bin width for dimension 1 and 200 as the bin width for dimension 2. 0 specifies the default for a dimension. So, binWidth(0,200) specifies the default bin width for dimension 1 and 200 as the bin width for dimension 2.

Description

Specifies the width of the bins.

Examples

Figure 1. Example: Defining a specific bin width
ELEMENT: interval(position(summary.count(bin.rect(salary, binWidth(1000)))))
Figure 2. Example: Defining a specific bin width for multiple binned dimensions
ELEMENT: interval(position(bin.rect(salbegin*salary, dim(1,2), binWidth(1000,2000))))
Figure 3. Example: Defining a specific bin width for date data
ELEMENT: interval(position(summary.count(bin.rect(date, binWidth(30d)))))