Learn R Programming

recharts (version 0.0.4)

eChartOutput: Wrapper functions for Shiny

Description

Use eChartOutput() to create a container for a ECharts widget in the UI, and renderEChart() to render the widget on the server side.

Usage

eChartOutput(outputId, width = "100%", height = "400px")

renderEChart(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

the output id to be used in the output object on the server side

width

the width of the chart

height

the height of the chart

expr

an R expression to return an EChart widget

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())? This is useful if you want to save an expression in a variable.

Examples

Run this code
# NOT RUN {
# !formatR
# }
# NOT RUN {
library(recharts)
library(shiny)
app = shinyApp(
  ui = fluidPage(eChartOutput('myChart')),
  server = function(input, output) {
    chart = echart(x = rnorm(100), y = rnorm(100))
    output$myChart = renderEChart(chart)
  }
)

if (interactive()) print(app)
# }

Run the code above in your browser using DataLab