Method Signatures
#Array methods
area ( x :: AbstractVector , y :: AbstractVector { <: Union { Missing , Real }})
area ( x :: AbstractVector , y :: AbstractArray { <: Union { Missing , Real }, 2 })
#Dataframe methods
area ( df :: AbstractDataFrame , x :: Symbol , y :: Symbol )
area ( df :: AbstractDataFrame , x :: Symbol , y :: Symbol , group :: Symbol )
#Other methods
area ( k :: KernelDensity . UnivariateKDE )
Optional Arguments
mark :: Union { String , AbstractVector } = "line"
fill :: Union { Bool , AbstractVector } = true
stack :: Union { Bool , AbstractVector , Void } = true
step :: Union { String , Void } = nothing #choice of {"start", "middle", "end"}
legend :: Bool = false
scale :: Bool = false
kwargs ... #modifies top-level EChart properties
Examples
Single Series
using ECharts
x = [ "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" , "Sunday" ]
y = [ 11 , 11 , 15 , 13 , 12 , 13 , 10 ]
ar = area ( x , y )
Multiple Series (Stacked Area)
The default when passed multiple series is to stack the series, i.e. showing the individual series contribution to the whole. If you want to overlay each series relative to zero on the Y-axis, use stack = false
.
In order for the stacked charts to render properly, any missing
values are set to 0 on render. If this is not the correct treatment, you need to remove missing
values prior to calling area()
.
using ECharts
x = [ "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" , "Sunday" ]
y = [ 11 , 11 , 15 , 13 , 12 , 13 , 10 ]
y2 = 3.7 .* y
as = area ( x , hcat ( y , y2 ))
Step Chart
using ECharts
x = [ "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" , "Sunday" ]
y = [ 11 , 11 , 15 , 13 , 12 , 13 , 10 ]
y2 = 3.7 .* y
astep = area ( x , hcat ( y , y2 ), step = "middle" )
DataFrame with group
argument
using ECharts , DataFrames
x = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
y = [ 28 , 43 , 81 , 19 , 52 , 24 , 87 , 17 , 68 , 49 , 55 , 91 , 53 , 87 , 48 , 49 , 66 , 27 , 16 , 15 ]
g = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ]
df_merged = DataFrame ( x = x , y = y , g = g )
adfg = area ( df_merged , : x , : y , : g )
UnivariateKDE
using ECharts
using KernelDensity , Distributions
#Set seed for repeatability
srand ( 1234 )
#Generate Beta dist, calculate kernel density estimate
x = rand ( Beta ( 3.0 , 2.0 ), 10 )
k = kde ( x )
a = area ( k )