Charts
area
ECharts.area — Function
area(x, y)Creates an EChart where region below plotted line filled with color.
Methods
area(x::AbstractVector, y::AbstractVector{<:Union{Missing, Real}})
area(x::AbstractVector, y::AbstractArray{<:Union{Missing, Real},2})
area(df::AbstractDataFrame, x::Symbol, y::Symbol)
area(df::AbstractDataFrame, x::Symbol, y::Symbol, group::Symbol)
area(k::KernelDensity.UnivariateKDE)Arguments
mark::Union{String, AbstractVector} = "line": how to display plotted pointsfill::Union{Bool, AbstractVector} = true: fill area below marks with color?stack::Union{Bool, AbstractVector, Void} = nothing: stack (add together) when multple series present?step::Union{String, Void} = nothing: one of {"start", "end", "middle", nothing}legend::Bool: display legend?scale::Bool = false: show full Y-axis or truncatedkwargs: varargs to set any field of resultingEChartstruct
Notes
Reasonable defaults set for different methods of area, such as displaying a legend when two or more series present.
Examples
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
ar = area(x, y)using ECharts
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
area(x, y)
bar
ECharts.bar — Function
bar(x, y)Creates an EChart where values plotted vertically as rectangular columns.
Methods
bar(x::AbstractVector, y::AbstractVector{<:Union{Missing, Real}})
bar(x::AbstractVector, y::AbstractArray{<:Union{Missing, Real},2})
bar(df::AbstractDataFrame, x::Symbol, y::Symbol)
bar(df::AbstractDataFrame, x::Symbol, y::Symbol, group::Symbol)Arguments
mark::Union{String, AbstractVector} = "bar": how to display plotted pointsstack::Union{Bool, AbstractVector, Void} = nothing: stack (add together) when multple series present?legend::Bool: display legend?scale::Bool = false: show full Y-axis or truncatedkwargs: varargs to set any field of resultingEChartstruct
Notes
Reasonable defaults set for different methods of bar, such as displaying a legend when two or more series present.
Examples
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
b = bar(x, y)using ECharts
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
bar(x, y)
box
ECharts.box — Function
box(data)Creates an EChart as a boxplot, optionally with outliers.
Methods
box(data::AbstractVector{<:Union{Missing, Real}})
box(data::AbstractVector{<:AbstractVector{<:Union{Missing, Real}}})
box(df::AbstractDataFrame, data::Symbol)
box(df::AbstractDataFrame, data::Symbol, group::Symbol)Arguments
names::Union{AbstractVector, Void} = nothing: provide names for seriesoutliers::Bool: show outliers?legend::Bool: display legend?horizontal::Bool = false: show horizontal? (default: vertical)kwargs: varargs to set any field of resultingEChartstruct
Notes
Reasonable defaults set for different methods of box, such as displaying a legend when two or more series present.
Examples
data = [850, 740, 900, 1070, 930, 850, 950, 980, 980, 880, 1000, 980, 930, 650, 760, 810, 1000, 1000, 960, 960]
b = box(data)using ECharts
data = [850, 740, 900, 1070, 930, 850, 950, 980, 980, 880, 1000, 980, 930, 650, 760, 810, 1000, 1000, 960, 960]
box(data)
bubble
ECharts.bubble — Function
bubble(x, y)Creates an EChart scatterplot, with additional dimension represented by circle size.
Methods
bubble(x::AbstractVector{<:Union{Missing, Real}}, y::AbstractVector{<:Union{Missing, Real}},
size::AbstractVector{<:Union{Missing, Real}})
bubble(df::AbstractDataFrame, x::Symbol, y::Symbol, size::Symbol)
bubble(df::AbstractDataFrame, x::Symbol, y::Symbol, size::Symbol, group::Symbol)Arguments
legend::Bool: display legend?scale::Bool = false: show full Y-axis or truncatedlarge::Bool = true: minimize overplottinglargeThreshold::Int = 2000: number of points before overplotting optimization occursbubblesize::Real = 50: maximum size of bubbles (see notes)kwargs: varargs to set any field of resultingEChartstruct
Notes
The displayed size of the bubble is normalized within the function, as the square root of the size values. Using the square root of the value maintains the proper visual perception of the difference. The overall circle size can be modified by the bubblesize keyword argument, which is roughly the area in pixels of the largest circle.
Examples
Random.seed!(13579)
xval = rand() .* (0:1000:30000)
yval = 60 .+ (rand(31) * 20)
sizeval = shuffle!(6000 .* (rand(31) * 50))
sp = bubble(xval, yval, sizeval, scale = true)using ECharts, Random
Random.seed!(13579)
xval = rand() .* (0:1000:30000)
yval = 60 .+ (rand(31) * 20)
sizeval = shuffle!(6000 .* (rand(31) * 50))
bubble(xval, yval, sizeval, scale = true)
candlestick
ECharts.candlestick — Function
candlestick(dt, open, close, low, high)Creates an EChart for visualizing financial prices of a security.
Methods
candlestick(dt::AbstractVector{String},
open::AbstractVector{<:Union{Missing, Real}},
close::AbstractVector{<:Union{Missing, Real}},
low::AbstractVector{<:Union{Missing, Real}},
high::AbstractVector{<:Union{Missing, Real}})
candlestick(dt::AbstractVector{<:Dates.TimeType},
open::AbstractVector{<:Union{Missing, Real}},
close::AbstractVector{<:Union{Missing, Real}},
low::AbstractVector{<:Union{Missing, Real}},
high::AbstractVector{<:Union{Missing, Real}})Arguments
legend::Bool: display legend?scale::Bool = false: show full Y-axis or truncatedkwargs: varargs to set any field of resultingEChartstruct
Notes
Candlestick plots are financial plots showing the relationship between the open, close, low and high prices for a security on a given day. For a more thorough description of the uses and subtleties of candlestick plots, see: http://www.datavizcatalogue.com/methods/candlestick_chart.html
Examples
dt = ["2016/08/26", "2016/08/29", "2016/08/30", "2016/08/31", "2016/09/01", "2016/09/02",
"2016/09/06", "2016/09/07", "2016/09/08", "2016/09/09", "2016/09/12", "2016/09/13",
"2016/09/14", "2016/09/15", "2016/09/16", "2016/09/19", "2016/09/20", "2016/09/21",
"2016/09/22", "2016/09/23", "2016/09/26"]
close_ = [12.38, 12.47, 12.55, 12.60, 12.44, 12.50, 12.67, 12.70, 12.73, 12.38, 12.70, 12.38, 12.14, 12.11, 12.11, 12.11, 12.00, 12.09, 12.18, 12.17, 12.01]
open_ = [12.47, 12.38, 12.46, 12.48, 12.66, 12.53, 12.49, 12.62, 12.50, 12.61, 12.32, 12.53, 12.18, 12.14, 12.05, 12.12, 12.09, 12.08, 12.17, 12.12, 12.12]
high_ = [12.55, 12.50, 12.56, 12.61, 12.72, 12.57, 12.67, 12.75, 12.75, 12.6850, 12.77, 12.68, 12.31, 12.18, 12.13, 12.33, 12.19, 12.11, 12.29, 12.22, 12.12]
low_ = [12.34, 12.38, 12.43, 12.48, 12.35, 12.46, 12.43, 12.62, 12.50, 12.38, 12.28, 12.33,12.11, 12.06, 12.01, 12.0586, 11.96, 12.01, 12.16, 12.12, 12.00]
c = candlestick(dt, open_, close_, low_, high_)using ECharts
dt = ["2016/08/26","2016/08/29","2016/08/30","2016/08/31","2016/09/01","2016/09/02",
"2016/09/06","2016/09/07","2016/09/08","2016/09/09","2016/09/12","2016/09/13",
"2016/09/14","2016/09/15","2016/09/16","2016/09/19","2016/09/20","2016/09/21",
"2016/09/22","2016/09/23","2016/09/26"]
close_ = [12.38,12.47,12.55,12.60,12.44,12.50,12.67,12.70,12.73,12.38,12.70,12.38,12.14,12.11,12.11,12.11,12.00,12.09,12.18,12.17,12.01]
open_ = [12.47,12.38,12.46,12.48,12.66,12.53,12.49,12.62,12.50,12.61,12.32,12.53,12.18,12.14,12.05,12.12,12.09,12.08,12.17,12.12,12.12]
high_ = [12.55,12.50,12.56,12.61,12.72,12.57,12.67,12.75,12.75,12.685,12.77,12.68,12.31,12.18,12.13,12.33,12.19,12.11,12.29,12.22,12.12]
low_ = [12.34,12.38,12.43,12.48,12.35,12.46,12.43,12.62,12.50,12.38,12.28,12.33,12.11,12.06,12.01,12.0586,11.96,12.01,12.16,12.12,12.00]
candlestick(dt, open_, close_, low_, high_)
corrplot
ECharts.corrplot — Function
corrplot(data)Creates an EChart showing pairwise correlations between columns of data.
Methods
corrplot(m::Matrix)
corrplot(df::AbstractDataFrame)Arguments
bubblesize::Int = 45: size of bubbleslayout::String = "lower": one of {"lower", "upper", nothing}kwargs: varargs to set any field of resultingEChartstruct
Notes
corrplot does not currently support missing values. Users should call completecases!() when using a DataFrame, or manually fill missing values as appropriate.
Examples
using ECharts, DataFrames, RDatasets
df = dataset("datasets", "mtcars")
cplot = corrplot(df)using ECharts, RDatasets
df = dataset("datasets", "mtcars")
corrplot(df)
donut
ECharts.donut — Function
donut(names, values)Creates an EChart where each value is represented as circular portion of the whole, with a hole removed from the center.
Methods
donut(names::AbstractVector, values::AbstractVector{<:Union{Missing, Real}})Arguments
selected::Union{AbstractVector, Void} = nothing: explode slice by positionradius::Union{AbstractVector, String} = ["50%", "80%"]:center::Union{AbstractVector, String} = ["50%", "50%"]:roseType::Union{String, Void} = nothing: one of {"angle", "radius", nothing}legend::Bool: display legend?kwargs: varargs to set any field of resultingEChartstruct
Notes
Examples
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
d = donut(x, y)using ECharts
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
donut(x, y)
funnel
ECharts.funnel — Function
funnel(names, values)Creates an EChart funnel.
Methods
funnel(names::AbstractVector, values::AbstractVector{<:Union{Missing, Real}})Arguments
legend::Bool: display legend?kwargs: varargs to set any field of resultingEChartstruct
Notes
Given the concept of a funnel (largest at top, narrowing), if you pass in the values out of order, the echarts.js library automatically sorts the numbers highest to lowest.
Examples
v = [100,60,80,70,50]
n = ["A", "B", "C", "D", "E"]
fn = funnel(n, v)using ECharts
funnel(["A","B","C","D","E"], [100, 60, 80, 70, 50])
gauge
ECharts.gauge — Function
gauge(x)Creates an EChart where a value is plotted as a needle indicating the value along some range.
Methods
gauge(x::Union{Missing, Real})Arguments
breakpoints::AbstractVector = [0.2, 0.8, 1]: percentage along gauge to switch indicator colorscolors::AbstractVector = ["#91c7ae", "#63869e", "#c23531"]: colors for breakpointskwargs: varargs to set any field of resultingEChartstruct
Notes
Examples
gg = gauge(27.64)using ECharts
gauge(27.64)
heatmap
ECharts.heatmap — Function
heatmap(data)Creates an EChart heatmap.
Methods
heatmap(h::StatsBase.Histogram)Arguments
legend::Bool = false: display legend?show::Bool = true: show slider denoting color rangecalculable::Bool = true: allow user to slide endpoints to change data displayedkwargs: varargs to set any field of resultingEChartstruct
Notes
Reasonable defaults set for different methods of area, such as displaying a legend when two or more series present.
Examples
using RDatasets
h2 = fit(Histogram, (df[:Price], df[:Carat]), closed = :left)
hs2 = heatmap(h2)using ECharts, StatsBase
h = fit(Histogram, (randn(10000), randn(10000)), nbins = 20)
heatmap(h)
histogram
ECharts.histogram — Function
histogram(data)Creates an EChart where region below plotted line filled with color.
Methods
histogram(h::StatsBase.Histogram)Arguments
legend::Bool = false: display legend?horizontal::Bool = false: show bars horizontally?kwargs: varargs to set any field of resultingEChartstruct
Notes
Reasonable defaults set for different methods of area, such as displaying a legend when two or more series present.
Examples
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
ar = area(x, y)using ECharts, StatsBase
h = fit(Histogram, randn(1000))
histogram(h)
line
ECharts.line — Function
line(x, y)Creates an EChart where region between points connected by a line.
Methods
line(x::AbstractVector, y::AbstractVector{<:Union{Missing, Real}})
line(x::AbstractVector, y::AbstractArray{<:Union{Missing, Real},2})
line(df::AbstractDataFrame, x::Symbol, y::Symbol)
line(df::AbstractDataFrame, x::Symbol, y::Symbol, group::Symbol)Arguments
mark::Union{String, AbstractVector} = "line": how to display plotted pointsstep::Union{String, Void} = nothing: one of {"start", "end", "middle", nothing}legend::Bool = false: display legend?scale::Bool = false: show full Y-axis or truncatedkwargs: varargs to set any field of resultingEChartstruct
Notes
Reasonable defaults set for different methods of area, such as displaying a legend when two or more series present.
Examples
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
ll = line(x, y)using ECharts
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
line(x, y)
pie
ECharts.pie — Function
pie(names, values)Creates an EChart where each value is represented as circular portion of the whole,
Methods
pie(names::AbstractVector, values::AbstractVector{<:Union{Missing, Real}})Arguments
selected::Union{AbstractVector, Void} = nothing: explode slice by positionradius::Union{AbstractVector, String} = "80%":center::Union{AbstractVector, String} = ["50%", "50%"]:roseType::Union{String, Void} = nothing: one of {"angle", "radius", nothing}legend::Bool: display legend?kwargs: varargs to set any field of resultingEChartstruct
Notes
Examples
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
pp = pie(x, y)using ECharts
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
pie(x, y)
polar
ECharts.polar — Function
polar(angle, radius)Creates an EChart where region between points connected by a line, with polar coordinates.
Methods
polar(angle::AbstractVector{<:Union{Missing, Real}}, radius::AbstractVector{<:Union{Missing, Real}})
polar(angle::AbstractVector{<:Union{Missing, Real}},radius::AbstractArray{<:Union{Missing, Real},2})Arguments
splitNumber::Int = 12: number of splits shown in axisshowSymbol::Bool = false: show the dots as well as the line?legend::Bool: display legend?kwargs: varargs to set any field of resultingEChartstruct
Notes
Reasonable defaults set for different methods of polar, such as displaying a legend when two or more series present.
Examples
t = 0:360
angle = [a / 180 * pi for a in t]
radius = [(sin(2t) * cos(2t)) for t in angle]
p = polar(angle, radius)using ECharts
t = 0:360
angle = [a / 180 * pi for a in t]
radius = [(sin(2a) * cos(2a)) for a in angle]
polar(angle, radius)
radar
ECharts.radar — Function
radar(names, values)Creates an EChart where region inside plotted line optionally filled with color.
Methods
radar(names::AbstractVector, values::AbstractVector{<:Union{Missing, Real}},
max::AbstractVector{<:Union{Missing, Real}})
radar(names::AbstractVector, values::AbstractArray{<:Union{Missing, Real},2},
max::AbstractVector{<:Union{Missing, Int, AbstractFloat, Rational}})Arguments
fill::Union{Bool, AbstractVector} = false: fill area inside marks with color?legend::Bool: display legend?kwargs: varargs to set any field of resultingEChartstruct
Notes
Examples
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
ar = area(x, y)using ECharts
names = ["Speed","Strength","Agility","Endurance","Accuracy"]
values = [80, 65, 90, 55, 75]
maxvals = [100, 100, 100, 100, 100]
radar(names, values, maxvals)
radialbar
ECharts.radialbar — Function
radialbar(x, y)Creates an EChart where values plotted as a percentage of cirlce as rectangular columns.
Methods
radialbar(x::AbstractVector, y::AbstractVector{<:Union{Missing, Real}})
radialbar(x::AbstractVector, y::AbstractArray{<:Union{Missing, Real},2})
radialbar(df::AbstractDataFrame, x::Symbol, y::Symbol)
radialbar(df::AbstractDataFrame, x::Symbol, y::Symbol, group::Symbol)Arguments
mark::Union{String, AbstractVector} = "bar": how to display plotted pointsstack::Union{Bool, AbstractVector, Void} = nothing: stack (add together) when multple series present?legend::Bool: display legend?scale::Bool = false: show full Y-axis or truncatedkwargs: varargs to set any field of resultingEChartstruct
Notes
Examples
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
b = radialbar(x, y)using ECharts
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
radialbar(x, y)
sankey
ECharts.sankey — Function
sankey(names, source, target, value)Creates an EChart diagram displaying the path and frequencies between nodes.
Methods
sankey(names::AbstractVector, source::AbstractVector{<:Union{Missing, Int}},
target::AbstractVector{<:Union{Missing, Int}}, value::AbstractVector{<:Union{Missing, Real}};
sankey(datafile::AbstractString)Arguments
kwargs: varargs to set any field of resultingEChartstruct
Notes
Examples
name = ["Agricultural waste", "Bio-conversion", "Liquid", "Losses", "Solid", "Gas", "Biofuel imports",
"Biomass imports", "Coal imports", "Coal"]
source = [0, 1, 1, 1, 1, 6, 7, 8, 10]
target = [1, 2, 3, 4, 5, 2, 4, 9, 9]
value = [124.729, 0.597, 26.862, 280.322, 81.144, 35, 35, 11.606, 63.965]
s = sankey(name, source, target, value)Using the second method mentioned above–as per http://sankeymatic.com/build/'s convention–you can have a datafile (call it input.txt), where each line has the information
SOURCE [AMOUNT] TARGETIn this case. SOURCE and TARGET are both Strings, where AMOUNT is a Real. For example:
Wages [2000] Budget
Interest [25] Budget
Budget [500] Taxes
Budget [450] Housing
Budget [310] Food
Budget [205] Transportation
Budget [400] Health Care
Budget [160] Other NecessitiesAnd simply run
s = sankey("input.txt")using ECharts
name = ["Agricultural waste","Bio-conversion","Liquid","Losses","Solid","Gas",
"Biofuel imports","Biomass imports","Coal imports","Coal"]
source = [0, 1, 1, 1, 1, 6, 7, 8, 10]
target = [1, 2, 3, 4, 5, 2, 4, 9, 9]
value = [124.729, 0.597, 26.862, 280.322, 81.144, 35, 35, 11.606, 63.965]
sankey(name, source, target, value)
scatter
ECharts.scatter — Function
scatter(x, y)Creates an EChart where (x,y) tuples are plotted as dots.
Methods
scatter(x::AbstractVector, y::AbstractVector{<:Union{Missing, Real}})
scatter(x::AbstractVector, y::AbstractArray{<:Union{Missing, Real},2})
scatter(df::AbstractDataFrame, x::Symbol, y::Symbol)
scatter(df::AbstractDataFrame, x::Symbol, y::Symbol, group::Symbol)Arguments
mark::Union{String, AbstractVector} = "scatter": how to display plotted pointslegend::Bool: display legend?scale::Bool = false: show full Y-axis or truncatedlarge::Bool = true: minimize overplottinglargeThreshold::Int = 2000: number of points before overplotting optimization occurskwargs: varargs to set any field of resultingEChartstruct
Notes
Examples
sc = scatter(rand(30), rand(30))using ECharts, Random
Random.seed!(42)
scatter(rand(50), rand(50))
streamgraph
ECharts.streamgraph — Function
streamgraph(x, y, group)Creates an EChart where region below plotted line filled with color.
Methods
streamgraph(x::AbstractVector{String},y::AbstractVector{<:Union{Missing, Real}},
group::AbstractVector)
streamgraph(x::AbstractVector{<:Union{Missing, Real}},
y::AbstractVector{<:Union{Missing, Real}},
group::AbstractVector)
streamgraph(df::AbstractDataFrame, x::Symbol, y::Symbol, group::Symbol)
streamgraph(x::AbstractVector{<:Dates.TimeType},y::AbstractVector{<:Union{Missing, Real}}, group::AbstractVector)Arguments
legend::Bool = false: display legend?kwargs: varargs to set any field of resultingEChartstruct
Notes
Examples
s_df = readtable(Pkg.dir("ECharts", "exampledata/streamdata.csv"))
sg = streamgraph(s_df[:date], s_df[:value], s_df[:key], legend = true)using ECharts, Dates
dates = repeat(Date(2020,1,1):Month(1):Date(2020,12,1), 3)
yvals = [10,12,8,15,20,18,22,19,14,11,9,13,
5,8,12,10,7,14,16,11,9,6,8,10,
3,5,6,4,8,9,7,6,5,4,6,7]
groups = vcat(fill("Series A",12), fill("Series B",12), fill("Series C",12))
streamgraph(dates, yvals, groups)waterfall
ECharts.waterfall — Function
waterfall(x, y)Creates an EChart representing the increase/decrease between two consecutive points.
Methods
waterfall(x::AbstractVector, y::AbstractVector{<:Real})Arguments
legend::Bool: display legend?scale::Bool = false: show full Y-axis or truncatedkwargs: varargs to set any field of resultingEChartstruct
Notes
Reasonable defaults set for different methods of area, such as displaying a legend when two or more series present.
Examples
x = 1:5
y = [2900, -1200, -300, -200, -900]
w = waterfall(x, y)using ECharts
waterfall(["Q1","Q2","Q3","Q4","Q5"], [2900, -1200, -300, -200, -900])