A histogram is a chart that groups your data points into a certain amount of so called 'bins' and shows you the number of data points that fall into each bin. The technical term for this is a frequency distribution.
When creating a widget, you can find the Histogram in the widget type selector under the chart category.
A histogram shares a lot of settings with the multi-chart and all widgets in general. For example the general widgets setting and color conditions, work the same as any other widget, and most of the settings in the histograms customization section are the same as in a multi chart. So in this section we will go over the most important differences. If you're looking for these more shared settings, please check out the widget, color condition and multi chart documentations.
When defining your data source for your histogram, you will notice that, contrary to most of the other chart types, e.g. a multi chart where you define separate columns for the x- and y-axis, the histogram only works on one data column. That's why you can only define one column of your selected data source in the select called Data column.
Furthermore, this select will only show you columns from your data source that are numeric, because a histogram only works on numeric data.
Histogram data source settings with a data column selected
Once you selected a data source and a data column, your histogram should already be visible in the widget preview. A Histogram looks pretty similar to a bar chart, except that we don't call the elements of a histogram bars, but bins. Like in the example below, if you hover over any bin in the chart, it shows you the so-called width of the bin, in this case 47.35 to 50.44 and the number of points in your data source that fall into this bin.
Example of a basic histogram.
Below the data source settings you can see a section called bin settings, where you are able to define some options on how the bins in your histogram should be generated.
The first setting in this section is the bin type. With this setting you can define, if your histogram should have a specific amount of bins (the count option), or you can use a specific width that every bin should have (the width option). If count is selected, the histogram will automatically calculate the width of your bins, and vice versa, if you select width, the number of bins will be calculated automatically.
To set either a number of bins, or the width of your bins, you can either use the data of any dataset or script, or you can use a fixed value. Note that when getting the value from a dataset or script, only the first row will be considered.
When selecting a dataset or script, you simply select a dataset or script and a column from where the value will be taken.
If you select a fixed data source type, there is a bit of a difference, however, depending on the setting you've chosen for the bin type.
With a bin type is set to width, you will be shown an input field where you choose any numeric value that will be set as the width of your bins. When your bin type is set to count, you get three predefined algorithms for calculating the number of bins, as well as a custom option where you can define a number yourself.
The three predefined algorithms are all based on the number of rows in your histograms data source, which we will call n. Here is a list of these algorithms and their formulas:
- Square root:
If you switch to the customize tab and open the chart section, the first option you will see is a toggle labeled Show data series. If you turn this setting on, the original data of your histogram will be added to your histogram as a second series. This also adds a new x- and y-axis to your histogram.
Histogram with the show data series option turned on