elineareaUI<- function(id){ ns<-NS(id) echarts4rOutput("elaplot") } elineareaServer<-function(id, dat){ moduleServer( id, function(input,output,session){ output$elaplot<- renderEcharts4r({ dat |> e_chart(x=month) |> e_line(serie = deviation.percent, smooth=T, color="cyan") |> e_area(serie = deviation.percent, smooth=T, color="cyan") |> e_axis_labels(x = "month", y="Deviation") |> e_format_y_axis(suffix = " %") |> e_title("Deviation", "Selected Cost Centers") |> e_tooltip(formatter = htmlwidgets::JS(" function(params){ return('Month: ' + params.value[0] + '
Deviation: ' + params.value[1] + '%') } ") ) |> e_legend(right = 100) |> e_datazoom(x_index = c(0, 1)) |> e_toolbox_feature(feature = c("saveAsImage","dataView")) |> e_theme("forest") }) } ) }