# Histogram Chart

In this article, we will explain how to create and customize a histogram chart. So let's get started!

A histogram is a chart that visualizes a dataset's distribution by plotting the frequency of data values in bins or ranges. The x-axis represents the data values, and the y-axis represents the frequency of those data values.

To create a histogram chart from ungrouped or unbinned data, you will need to first group the data into bins or ranges. This tool will automatically group the data into bins based on the distribution of the data. Infinity automatically determines the number of bins to use and sets their widths to be equal. The height of each bin is proportional to the number of data points it contains.

Here is an example of a histogram chart with sample data:

This histogram shows the distribution of population among a group of 50 countries. The x-axis represents the population ranges, and the y-axis represents the frequency of countries in each population bin.

Sample data:

CountryPopulation (millions)Area (sq miles)

China

1,439

9,596,961

India

1,380

3,287,263

United States

331

3,796,742

Indonesia

273

735,358

Brazil

212

3,288,470

Pakistan

220

310,403

Nigeria

206

356,669

164

147,570

Russia

145

6,612,100

Mexico

128

761,606

Japan

126

145,936

Philippines

108

115,830

Vietnam

97

128,537

Egypt

98

386,660

Iran

84

636,000

Turkey

84

302,535

Democratic Republic of the Congo

87

905,567

Thailand

69

198,115

France

65

248,573

United Kingdom

67

93,628

Italy

60

116,303

South Africa

59

471,011

Myanmar

54

261,228

South Korea

52

38,491

Colombia

50

439,736

Spain

47

195,124

Argentina

45

1,068,302

Ukraine

43

233,062

38

3,855,103

Morocco

36

172,414

Iraq

40

168,754

Afghanistan

38

249,999

Peru

32

496,000

Saudi Arabia

34

830,000

Angola

32

481,000

Venezuela

28

352,144

Malaysia

32

127,000

Yemen

29

203,850

North Korea

25

46,528

Nepal

29

56,827

Sudan

41

967,490

Ghana

31

92,098

Mozambique

31

309,496

Australia

25

2,969,907

Taiwan

24

13,892

Ivory Coast

26

124,503

27

226,658

Cameroon

26

183,569

Romania

19

92,043

Syria

18

71,500

### How-to build a histogram chart?

1. Navigate to Add New Chart screen

2. Configure and customize the chart to create the desired visualization.

### Histogram chart configuration:

A histogram chart can display multiple series of data in a single chart. To create a one-series chart, you will need at least two columns of data. The first column represents the name of the dimension, and the second column represents the metric to be plotted on the chart.

1) This configuration demonstrates how to set up a one-series histogram chart by mapping the necessary data fields. The "Dimension" and "Metric" fields are required, and you can map multiple data series to the "Metric" field if desired.

2) To customize the appearance of an area chart, follow these steps:

1. Click on the "Customize" tab

2. Go to "Other" accordion to select the desired options

3. Select the desired customization options, such as bucket sizes, max and min buckets and algorithm for bucket computation and more

Hide Bucket Items : Removes the thin divisions between the blocks of the histogram to create a series of solid bars.

Bucket Size: Manually set the size of each histogram bar rather than allowing it to be calculated automatically.

Last Bucket Percentile: This feature allows you to specify a percentage of values to exclude from the calculation of bucket sizes. These values will still be included in the histogram, but will not affect the bucket sizes. This can be useful if you don't want outliers to create their own buckets and would prefer for them to be grouped with the first or last bucket instead.

Min Value (bucket): Limits the min range of buckets to include this value.

Max Value (bucket): Limits the max range of buckets to include this value.

Max Num of buckets: Limits the maximum number of buckets to this value

Bucketing Algorithm: There are three algorithms that can be used to determine the default number of buckets for a histogram chart. These algorithms are:

• 'sqrt': This algorithm calculates the square root of the number of data points.

• 'sturges': This algorithm is based on the binomial distribution and assumes an approximately normal distribution of the data.

• 'rice': This is a simpler alternative to the 'sturges' algorithm."

These options allow you to tailor the appearance of the histogram chart to your specific needs and preferences. You can customize a variety of options to create a chart that effectively communicates your data and insights.

Histograms are often used to visualize the distribution of a dataset and to identify patterns and trends in the data. They can be particularly useful for understanding the shape of a dataset and for identifying outliers or anomalies in the data.

There are a few useful tips to keep in mind when using histograms:

1. Make sure to clearly label the chart and include a descriptive title.

2. Use a clear and readable font for the labels and axis ticks to make it easier for readers to understand the chart.

3. Choose an appropriate bin size for the data. If the bins are too small, the histogram may be too cluttered, while if the bins are too large, the histogram may not show enough detail.

4. Use colors and patterns effectively to differentiate between different data points and to make the chart more visually appealing.

Histograms are best suited for visualizing the distribution of continuous data. If you have categorical data, you may want to consider using a different type of chart, such as a bar chart.

### Histogram chart customization options:

Infinity offers many customization options for your chart. To access these options, click on the customize tab in the chart builder screen. This will display a list of customization options.

Here is a list of additional customization options for the histogram chart.

FeatureDescription

Aggregation

To create an aggregation, click on the data series chip in the data mapping section and choose the desired aggregation.

There are various aggregation options available based on the data type.

Renaming the Data Series

To rename a data series, click on the data series chip in the data mapping section. A pop-up will appear, allowing you to change the name and any aggregation options.

Titles

To change the titles, follow these steps:

• Click on the customization tab.

• Click on the horizontal (or) vertical axes.

• Proceed to change the titles.

Chart Background

To change the chart background, follow these steps:

• Click on the customization tab.

• Click on the chart background.

• Proceed to selecting the desired color.

To change the padding and zoom, follow these steps:

• Click on the customization tab.

• Click on the padding and zoom accordion.

• Proceed to customize the padding and zoom attributes for your chart.

Legend

To customize the legend, follow these steps:

• Click on the customization tab.

• Click on the legend accordion.

• The platform offers four legend options: top, bottom, right, or none.

• You can also configure the legend font here.

Axes

To customize the axes, follow these steps:

• Click on the customize tab.

• Select the desired axes (horizontal for X, vertical for Y, and right vertical for secondary Y).

• Proceed to changing the title, fonts, labels, order of axes, scale, or even add formatting such as \$ or %.

Gridlines

To change the grid lines, follow these steps:

• Click on the customize tab.

• Select the gridlines accordion.

• Select the orientation (i.e. vertical or horizontal).

Last updated