df <- airquality |> dplyr::mutate(
lwr= round(Temp-Wind*2),
upr= round(Temp+Wind*2),
x= paste0(Month,'-',Day) ) |>
dplyr::relocate(x, Temp)
bands <- ecr.band(df, 'lwr', 'upr', type='stack',
name= 'stak', areaStyle= list(opacity=0.4))
df |> ec.init( load= 'custom',
legend= list(show= TRUE),
dataZoom= list(type= 'slider'),
toolbox= list(feature= list(dataZoom= list(show= TRUE))),
xAxis= list(type= 'category', boundaryGap= FALSE),
series= list(
list(type='line', color='blue', name='line'),
bands[[1]], bands[[2]]
),
tooltip= list( trigger= 'axis',
formatter= ec.clmn(
'high %@line %@low %@',
3.3, 1.2, 2.2)
) # 3.3= upper_serie_index +.+ index_of_column_inside
)
Run the code above in your browser using DataLab