You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
963 B

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] + '<br />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")
})
}
)
}