Modifier Functions
Modifier functions (those ending with !) adjust an existing EChart in place and return the modified chart.
aria!
ECharts.aria! — Function
aria!(ec)Adds or modifies ARIA (Accessible Rich Internet Applications) settings for an EChart.
Methods
aria!(ec::EChart; show, description, general, series, data)Arguments
show::Bool = true: enable ARIAdescription::Union{String, Nothing} = nothing: custom description for screen readersgeneral::Union{Dict, Nothing} = nothing: general ARIA configuration dictseries::Union{Dict, Nothing} = nothing: per-series ARIA configuration dictdata::Union{Dict, Nothing} = nothing: per-data ARIA configuration dict
Examples
b = bar(["A","B","C"], [1,2,3])
aria!(b)colorscheme!
flip!
jitter!
ECharts.jitter! — Function
jitter!(ec)Adds random jitter to data points in an EChart to reduce overplotting. The jitter amount is a random percentage of the data range, following the range method from Chambers, Cleveland, Kleiner, and Tukey (1983).
Methods
jitter!(ec::EChart, series::Int; pctxrange, pctyrange)
jitter!(ec::EChart; pctxrange, pctyrange)Arguments
series::Int: index of the series to jitter (single-series method only)pctxrange::Real = 0.05: maximum jitter as a fraction of the x data rangepctyrange::Real = 0: maximum jitter as a fraction of the y data range
Notes
When called without a series argument, jitter is applied to all series.
Examples
s = scatter([1,1,2,2,3], [1,1,2,2,3])
jitter!(s)labels!
ECharts.labels! — Function
labels!(ec)Shows or hides data labels on an EChart.
Methods
labels!(ec::EChart, series::Int; show, position)
labels!(ec::EChart; show, position)Arguments
series::Int: index of the series to modify (single-series method only)show::Bool = true: display labelsposition::String = "insideTop": label position (e.g."insideTop","top","inside","bottom")
Notes
When called without a series argument, labels are applied to all series.
Examples
b = bar(["A","B","C"], [1,2,3])
labels!(b)legend!
lineargradient
ECharts.lineargradient — Function
lineargradient(color1, color2)Creates a linear gradient JSFunction for use with colorscheme! or other color arguments. The gradient transitions from color1 at offset 0 to color2 at offset 1.
Methods
lineargradient(color1::String, color2::String; x0, y0, x2, y2)Arguments
color1::String: starting color (CSS color string)color2::String: ending color (CSS color string)x0::Number = 0: x coordinate of gradient start (0–1)y0::Number = 0: y coordinate of gradient start (0–1)x2::Number = 0: x coordinate of gradient end (0–1)y2::Number = 1: y coordinate of gradient end (0–1)
Examples
b = bar(["A","B","C"], [1,2,3])
colorscheme!(b, lineargradient("#e96c5b", "#47a0d5"))radial!
radialgradient
ECharts.radialgradient — Function
radialgradient(color1, color2)Creates a radial gradient JSFunction for use with colorscheme! or other color arguments. The gradient transitions from color1 at offset 0 to color2 at offset 1.
Methods
radialgradient(color1::String, color2::String; x, y, r)Arguments
color1::String: starting color at center (CSS color string)color2::String: ending color at edge (CSS color string)x::Number = 0.5: x coordinate of gradient center (0–1)y::Number = 0.5: y coordinate of gradient center (0–1)r::Number = 0.5: radius of gradient (0–1)
Examples
b = bar(["A","B","C"], [1,2,3])
colorscheme!(b, radialgradient("#e96c5b", "#47a0d5"))seriesnames!
slider!
ECharts.slider! — Function
slider!(ec)Adds a data zoom slider to an EChart, allowing the user to pan and zoom along the data axis.
Methods
slider!(ec::EChart)Examples
b = bar(["A","B","C","D","E"], [1,2,3,4,5])
slider!(b)smooth!
text!
theme!
ECharts.theme! — Function
theme!(ec, theme)Sets the theme for an EChart.
Methods
theme!(ec::EChart, theme::Theme)Arguments
theme::Theme: aThemeobject specifying visual styling
Examples
b = bar(["A","B","C"], [1,2,3])
theme!(b, Theme(backgroundColor = "#1b1b1b"))title!
toolbox!
tooltip!
ECharts.tooltip! — Function
tooltip!(ec)Adds or modifies the tooltip for an EChart.
Methods
tooltip!(ec::EChart; show, kwargs...)Arguments
show::Bool = true: display the tooltipkwargs: any additional field of theTooltipstruct (e.g.trigger,formatter)
Examples
b = bar(["A","B","C"], [1,2,3])
tooltip!(b, trigger = "axis")xarea! / yarea!
ECharts.yarea! — Function
yarea!(ec, startval, endval)Adds a shaded region along the y-axis to highlight a range of y values on an EChart.
Methods
yarea!(ec::EChart, startval, endval; series, kwargs...)Arguments
startval: y-axis value where the shaded region startsendval: y-axis value where the shaded region endsseries::Int = 1: index of the series to attach the region tokwargs: additionalItemStylefields for the shaded area (e.g.color,opacity)
Examples
b = bar(["A","B","C"], [1,2,3])
yarea!(b, 1.5, 2.5, color = "rgba(200,200,200,0.4)")xaxis! / yaxis!
ECharts.xaxis! — Function
xaxis!(ec)Modifies x-axis properties of an EChart.
Methods
xaxis!(ec::EChart; formatter, kwargs...)Arguments
formatter::Union{String, JSFunction, Nothing} = nothing: axis label format string or JS functionkwargs: any field of theXAxisstruct (e.g.name,type,boundaryGap)
Examples
b = bar(["A","B","C"], [1,2,3])
xaxis!(b, name = "Category")ECharts.yaxis! — Function
yaxis!(ec)Modifies y-axis properties of an EChart.
Methods
yaxis!(ec::EChart; formatter, kwargs...)Arguments
formatter::Union{String, JSFunction, Nothing} = nothing: axis label format string or JS functionkwargs: any field of theYAxisstruct (e.g.name,min,max,type)
Examples
b = bar(["A","B","C"], [1000, 2000, 3000])
yaxis!(b, name = "Revenue", formatter = "${value}")xgridlines! / ygridlines!
ECharts.ygridlines! — Function
ygridlines!(ec)Configures the y-axis grid lines for an EChart.
Methods
ygridlines!(ec::EChart; show, interval, kwargs...)Arguments
show::Bool = true: display grid linesinterval::Union{Int, String, JSFunction, Nothing} = "auto": interval between grid lineskwargs: additionalLineStylefields (e.g.color,width,type)
Examples
b = bar(["A","B","C"], [1,2,3])
ygridlines!(b, show = false)