The xarea! and yarea! functions are a means of highlighting an area of the chart between two values. The shaded area will assume the same color of the series where it is placed (by default, series = 1). This type of shading often seen in economics graphs, such as those plotting a metric such as GDP and highlighting areas where recessions had occurred.

Method Signatures

xarea!(ec::EChart, startval, endval)

yarea!(ec::EChart, startval, endval)

Optional Keywords

series::Int = 1
color::Union{String, JSFunction, Void} = nothing
barBorderColor::Union{String,Void} = nothing
borderColor::Union{String,Void} = nothing
borderWidth::Union{Int,Void} = nothing
shadowBlur::Union{Int,Void} = nothing
shadowColor::Union{String,Void} = nothing
shadowOffsetX::Union{Int,Void} = nothing
shadowOffsetY::Union{Int,Void} = nothing
opacity::Union{Float64,Void} = nothing


Highlight X areas

using ECharts, RDatasets
df = dataset("datasets", "mtcars")
sgrp = scatter(df, :MPG, :HP, :Cyl)

xarea!(sgrp, 28, 33)
xarea!(sgrp, 10, 14)

Add Y area highlight to existing X highlights

yarea!(sgrp, 100, 150, series = 2)