added function for creating an interactive legend for multiple time series