rstudio / dygraphs

R interface to dygraphs
http://rstudio.github.io/dygraphs
Other
364 stars 194 forks source link

Limit of 10 series when add data to plot by dySeries in dygraph Vers. > 1.1.1.4 #235

Open woec opened 4 years ago

woec commented 4 years ago

Hi, I created a shiny application which draws timeseries data in a single dygraph plot. If the dygraph is rendered at once, any arbitrary number of time series can be plotted in one graph plot. But if I add additional timeseries by use of dySeries command, there seems to be a limit of 10 total numbers of series to be plotted. If, for example, 8 series are drawn initial and 3 series are added by g <- dySeries(g, c('lval','value','hval') ....) to get a shaded curve of a new time series with low- and high values, the following error appears: Error in <-: 'names' attribute [11] must be the same length as the vector [10]

I tried some combinations of numbers of initial series and added by dySeries , the error only appears, if the total number exceeds 10.

This happens when one of the newest dygraphs versions is used (1.1.1.6 or 1.1.1.5), but works as expected when dygraphs 1.1.1.4 is used.

Are there bugs introduced in the newest versions of dygraphs ?

Regards, woec

woec commented 4 years ago

Hi,

I found the cause for the problem: in my application I used a custom color vector for coloring the data. This vector was of size 10. In the new dygraphs versions > 1.1.1.4 the lack of enough elements for coloring when adding graphs with dySeries(....) is handled differently compared to the previous versions. The old versions cycle the color vector up to the necessary size automatically, the new versions do not. This leads to the error message described.

Regards, woec