fig <- plotly::plot_ly(
type = 'scatterpolar',
mode='lines',
r = c(14,12,8,8,6,14),
theta = c('RCB','CSK','MI','RR','KKR','RCB'),
fill = 'toself',
line = list(shape = 'spline'),
name="2016"
)
# Adding another trace to the plot
fig <- fig %>% add_trace(r = c(8,12,12,10,6,8),
theta = c('RCB','CSK','MI',
'RR','KKR','RCB'),
fill = 'toself',
line = list(shape = 'spline'),
name="2017")
# Specifying the layout of radar plot
fig <- fig %>% layout(polar=list(radialaxis =
list(visible = T,
range = c(0,20))),
title="Nested Radar Plot using Plotly")
fig