graph_histogram
Draw an histogram from a list of values. Values are grouped into bins.
graph_histogram(
values,
bins,
[width=320],
[height=200],
[padding=20],
[graduations],
[xmin],
[xmax],
[ymin],
[ymax],
[stroke=#000000],
[fill=#FFFFFF],
[weight=1.00]
)
Draw an histogram from a list of values. Values are grouped into bins.
Syntaxe
var v = [1, 2, 2, 3, 4, 4, 4, 10];
graph_histogram(v, bins=5, fill="#3F51B5");
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
values | yes | - | List of values | |
bins | yes | - | Number of bins | |
width | - | 320 | width of graph area | |
height | - | 200 | height of graph area | |
padding | - | 20 | Internal padding | |
graduations | - | - | Color of axes and ticks (e.g. '#000'). If 'none', no graduations. | |
xmin | - | - | Override minimum X value | |
xmax | - | - | Override maximum X value | |
ymin | - | - | Override minimum Y value | |
ymax | - | - | Override maximum Y value | |
stroke | - | #000000 | Stroke color | |
fill | - | #FFFFFF | Fill color | |
weight | - | 1.00 | Stroke weight (thickness) |