bubble is an extension of the scatter function, adding a size argument to add a 3rd dimension to represent some additional quantity along with the X and Y series’. 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.

Method Signatures

#Array methods
bubble(x::AbstractVector, y::AbstractVector{<:Union{Missing, Real}},
    size::AbstractVector{<:Union{Missing, Real}})

#Dataframe methods
bubble(df::AbstractDataFrame, x::Symbol, y::Symbol, size::Symbol)
bubble(df::AbstractDataFrame, x::Symbol, y::Symbol, size::Symbol, group::Symbol)

Optional Arguments

legend::Bool = false
scale::Bool = false
large::Bool = true #optimize rendering in presence of larger data
largeThreshold::Int = 2000 #number of points considered "larger" data
bubblesize::Real = 50
kwargs...(modifies top-level `EChart` fields)


Single Series - Array

using ECharts
xval = rand() .* (0:1000:30000)
yval = 60 .+ (rand(31) * 20)
sizeval = shuffle!(6000 .* (rand(31) * 50))

sp = bubble(xval, yval, sizeval, scale = true)

Single Series - DataFrame

using ECharts, DataFrames, RDatasets
df = dataset("datasets", "mtcars")
sgrp = bubble(df, :MPG, :HP, :Disp)

Mutliple Series - DataFrame

using ECharts, DataFrames, RDatasets
df = dataset("datasets", "mtcars")
bgrp = bubble(df, :MPG, :HP, :Disp, :Cyl)