The legend! function is just a convenience around the Legend type, so that end-users don’t need to reference ec.legend directly (though, nothing prevents users modifying the EChart chart instance). Legends are automatically displayed when two or more series are plotted in the same chart.

Method Signatures

legend!(ec::EChart)

Optional Arguments

show::Union{Bool,Void} = true
zlevel::Union{Int,Void} = 0
z::Union{Int,Void} = 2
left::Union{Int,String,Void} = nothing
top::Union{Int,String,Void} = "auto"
right::Union{Int,String,Void} = "auto"
bottom::Union{Int,String,Void} = "auto"
width::Union{Int,String,Void} = "auto"
height::Union{Int,String,Void} = "auto"
orient::Union{String,Void} = "horizontal"
align::Union{String,Void} = "auto"
padding::Union{Int,Void} = 5
itemGap::Union{Int,Void} = 10
itemWidth::Union{Int,Void} = 25
itemHeight::Union{Int,Void} = 14
formatter::Union{String,Void, JSFunction} = nothing
selectedMode::Union{Bool,String,Void} = true
inactiveColor::Union{String,Void} = "#ccc"
selected::Union{Dict{String,Bool},Void} = nothing
textStyle::Union{TextStyle,Void} = nothing
tooltip::Union{Tooltip, Void} = nothing
data::Union{AbstractVector,Void} = nothing
backgroundColor::Union{String,Void} = "transparent"
borderColor::Union{String,Void} = "transparent"
borderWidth::Union{Int,Void} = 1
shadowBlur::Union{Int,Void} = nothing
shadowColor::Union{String,Void} = nothing
shadowOffsetX::Union{Int,Void} = 0
shadowOffsetY::Union{Int,Void} = 0

Examples

using ECharts
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]
bm = bar(x, hcat(0.95 .* y, 1.25 .* y, y), color = ["red", "gray", "blue"], stack = true, legend = false)
legend!(bm)