set.seed(222)
df <- data.frame( x = 1:10, y = round(runif(10, 5, 10),2)) |>
dplyr::mutate(lwr= round(y-runif(10, 1, 3),2), upr= round(y+runif(10, 2, 4),2) )
banda <- ecr.band(df, 'lwr', 'upr', type='stack', name='stak', areaStyle= list(color='green'))
#banda <- ecr.band(df, 'lwr', 'upr', type='polygon', name='poly1')
df |> ec.init( load='custom', # polygon only
legend= list(show= TRUE),
xAxis= list(type='category', boundaryGap=FALSE), # stack
#xAxis= list(scale=T, min='dataMin'), # polygon
series= append(
list(list(type='line', color='blue', name='line1')),
banda
),
tooltip= list(trigger='axis', formatter= banda[[1]]$tipFmt)
)
Run the code above in your browser using DataLab