Skip to examples
Browse chart types
Chart library26 ways to visualize

STATISTICS / CHART GUIDE

Histogram

A histogram is a chart that displays data distribution, using bars to represent the frequency of data points within a certain range.

01 / EXPLORE

See it in action.

Switch to Code to copy an example.

Distribution of 200 students exam scores (normal distribution)

Product weight distribution (150 samples), custom colors

Bimodal distribution data, custom colors

About Histogram

A histogram is a chart that displays data distribution, using bars to represent the frequency of data points within a certain range. The height (or length) of each bar represents the number of data points falling within a specific interval, the X-axis represents the range of data values, and the Y-axis represents the frequency or count. Histograms are primarily used to represent the distribution of continuous variables and help analyze the central tendency, dispersion, and shape of data. The difference between a histogram and a bar chart: a histogram reflects data distribution, while a bar chart only compares values. In terms of data structure, a bar chart requires a categorical variable that is discrete (e.g., Class 1, Class 2, Class 3), so there are gaps between bars. But histogram data consists of continuous numerical variables (e.g., scores), so there are no gaps between bars.

02 / CONFIGURE

Make it yours.

The properties available for this chart.

Configuration Options

PropertyTypeRequiredDescription
typestringrequiredValue must be "histogram".
datanumber[]requiredChart data.
binNumbernumberoptionalNumber of bins in the histogram.
titlestringoptionalChart title.
axisXTitlestringoptionalX-axis title.
axisYTitlestringoptionalY-axis title.
themeBuiltinThemeName | ThemeSpecoptionalBuilt-in theme name or custom theme object; default is "default". See Documentation → Custom Themes.
styleObjectoptionalChart style.
style.backgroundColorstringoptionalMust be a valid color value.
style.palettestring[]optionalMust be an array of valid color values.
GPT-Vis · An AntV project · MIT licensed