First, you should load recharts:

library(recharts)

1 Introduction

Venn has very limited functionalities in Echarts.

The keys are:

  • character x and numeric y
  • 3 rows with which the last row is the intersect
  • series is not applicable

2 Function Call

echartr(data, x, y, <t>, <type>)
Arg Requirement

data

source data in the form of data.frame

x

character independent variable. Only the first one is accepted if multiple variables are provided.

y

numeric dependent variable. Only the first four ones are accepted.

t

timeline variable which will be coerced to factors. Only the first one is accepted if multiple variables are provided.

type

‘venn’

3 Showcase

3.1 Data Preparation

Here is a fictious dataset.

data = data.frame(x=c('Collection 1', 'Collection 2', 'Intersection'), 
                  y=c(40,50,20))
knitr::kable(data)
x y
Collection 1 40
Collection 2 50
Intersection 20

3.2 Basic Venn

echartr(data, x, y, type='venn') %>% 
    setTitle('Venn', 'Fictious Data')

4 Futher Setup

Then you can configure the widgets, add markLines and/or markPoints, fortify the chart.

You can refer to related functions to play around on your own.