Home

Awesome

<img src='man/figs/logo.png' width='70px' alt='' /> echarty

<!-- badges: start -->

R-CMD-check coverage size website twitter

<!-- [![CRAN downloads](https://cranlogs.r-pkg.org/badges/last-day/echarty)](https://cranlogs.r-pkg.org/badges/last-day/echarty) --> <!-- badges: end -->

<a href='https://helgasoft.github.io/echarty'><img src="man/figs/echarty.gallery.png" alt="echarty.gallery" /></a>

This package is a thin R wrapper around Javascript library ECharts.
One major command(ec.init) uses R lists to support the ECharts API.
Benefit from ECharts full functionality and build interactive charts in R and Shiny with minimal overhead.

Wider connectivity and deployment potential through WebR and crosstalk.

<details> <summary><b>Compare to echarts4r</b> 📌</summary>
R packageecharts4recharty
initial commitMar 12, 2018Feb 5, 2021
library size878 KB224KB
test coverage32% link93% link
lines of code1,202,623 link5,517 link
API design <sup>(1)</sup>own commands with parametersmostly ECharts option lists
number of commandsover 200one command + optional utility commands
data storage supportseries datadatasets, series data
dependencies (packrat)6540
dependencies (WebR)18846
WebR supportnoyes
crosstalk supportnoyes
utilitiesbezier, correlations, histogram, density, loess, flip, nesting, moreextended boxplots, tabsets, layouts, shapefiles, lotties, more

<sup>(1)</sup> We encourage users to follow the original ECharts API to construct charts with echarty. This differs from echarts4r which uses own commands for most chart options.

Comparison review done Feb 2024 for current versions of echarts4R and echarty.


</details>

Please consider granting a Github star ⭐ to show your support.

Installation

<!-- [![Github version](https://img.shields.io/github/v/release/helgasoft/echarty?label=github)](https://github.com/helgasoft/echarty/releases) <sup>.02</sup> -->

Latest development build 1.6.4

if (!requireNamespace('remotes')) install.packages('remotes')
remotes::install_github('helgasoft/echarty')

CRAN
status From CRAN:

install.packages('echarty')

Examples

library(echarty); library(dplyr)

#  scatter chart (default)
cars |> ec.init()

#  parallel chart
ToothGrowth |> ec.init(ctype= 'parallel')

#  3D chart with GL plugin
iris |> group_by(Species) |> ec.init(load= '3D')

#  timeline of two series with grouping, formatting, autoPlay
iris |> group_by(Species) |> 
ec.init(
  timeline= list(autoPlay= TRUE),
  series.param = list(
    symbolSize= ec.clmn('Petal.Width', scale= 9),
    encode= list(x= 'Sepal.Width', y='Petal.Length'),
    markLine= list(data= list(list(type='max'), list(type='min')))
  )
)

# show a remote map chart, needs package leaflet installed
echarty::ec.fromJson('https://helgasoft.github.io/echarty/test/pfull.json')

Get started

The Coder is a good introduction, type library(echarty); demo(coder).
The WEBSITE has a vast gallery with code and tutorials.
The package itself has also code examples included. Type ?ec.examples, then copy/paste any code to see the chart.

Now you can start building beautiful ECharts (and more) with R and Shiny!

<br> <p align="center"> <a href='https://helgasoft.github.io/echarty/gallery.html' target='_blank'> <img src="man/figs/ssPolarStack.png" alt="Polar Stack" width="180"/> <img src="man/figs/ssBars.gif"/> <img src="man/figs/ssThemeRiver.png" width="180"/> <img src="man/figs/ssBunny.gif"/> <br> <!-- img src="man/figs/ssMorph.gif" width="180"/ --> <img src="man/figs/ssRose.png" width="180"/> <img src="man/figs/ssSpeed.png" width="180"/> <img src="man/figs/ssStackBar.png" width="180"/> </a> <br>Made with echarty. Powered by ECharts. </p>