The ECharts.jl package provides a Julia wrapper around the ECharts 4 JavaScript library from Baidu.

In particular, ECharts.jl provides:

  • High-level functions for quickly creating visualizations such as bar charts, area charts, line charts and others
  • Support for ColorBrewer color scales via the ColorBrewer.jl package and other fun colors via the NoveltyColors.jl package, for visually stunning color schemes
  • Inline output via IJulia (Jupyter Notebook) and Juno, and REPL support via Blink.jl

Motivation

The idea behind the API of ECharts.jl is simplicity; while it is possible to build complex graphics in ECharts.jl, the goal of this package is to provide a means of creating common visualizations with a minimum of configuration and syntax. This is achieved through:

  • A minimum of required arguments to create a chart (i.e. usually, only data are required), with common optional arguments defined based on the chart type
  • Sensible/opinionated defaults, such as a legend only being shown when two or more series plotted and tooltip-on-hover enabled automatically.
  • Integrated missing value support (see chart docs for implementation details)
  • Tight integration with the echarts4 JavaScript library, which provides rich interactivity (i.e. sliders, hover, toolbox, themes) as default

Workflow

  1. Choose a base chart type
  2. (Optional) Use one of more visualization mutating functions (the functions with a ! on the end) to modify the base chart
  3. (Optional) Set individual fields in the resulting EChart composite type for even more refinement

For example, to create an area chart with gradient shading (lineargradient), a smoothed line (smooth!) and label the axes (xaxis!/yaxis!):

#Define data
x = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
y = [11, 11, 15, 13, 12, 13, 10]

#Step 1: Choose a base chart type
ar = area(x, y, color = lineargradient("purple", "cyan"))

#Step 2: Apply visualization mutating functions
smooth!(ar)
xaxis!(ar, name = "Day of Week")
yaxis!(ar, name = "Daily High Temperature °C")

To learn more about specific features, see the Table of Contents on the left sidebar. For inspiration, see the Baidu demos to see what is (likely) possible and the user-submitted gallery (may require additional JS libraries not implemented in Julia).