The histogram function extends the Histogram type from the StatsBase package. The current design is to assume that the user fits the histogram themselves (see examples below) and passes the result type to the histogram() function. Future releases may provide methods which wrap the calculation and visualization steps within a single histogram function call.

Note that the histogram function is only defined for up to two-dimensional histograms; this is a limitation of echarts.js (which doesn’t support 3-D visualizations).

Method Signatures

histogram(h::StatsBase.Histogram)

Optional Arguments

legend::Bool = false
horizontal::Bool = false
kwargs... #modifies top-level `EChart` fields

Missing Value Support

Examples

Single Series (1-D Histogram)

using ECharts, RDatasets, StatsBase
df = dataset("ggplot2", "diamonds")
h = fit(Histogram, df[:Price], closed = :left)
hs = histogram(h)

Multiple Series (2-D Histogram)

using ECharts, RDatasets, StatsBase
h2 = fit(Histogram, (df[:Price], df[:Carat]), closed = :left)
hs2 = histogram(h2)