if (interactive()) {
df <- airquality |> mutate(lwr= round(Temp-Wind*2),
upr= round(Temp+Wind*2),
x= paste0(Month,'-',Day) ) |>
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),
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