Series color graph
Dygraph can assign different color palettes to each visualization line. For example, our four-parameter in TSLA data (open, high, low, close) can be represented as different colors. Dygraph provides dyOptions() in which colors parameter can be useful to identify each stock line smoothly.
R
# RColorBrewer used to create nice color palettes # display.brewer.pal(n, name) dygraph (price, main = "TSLA Stock price analysis" ) %>% dyOptions (colors = RColorBrewer:: brewer.pal (4, "Dark2" )) |
Output:
How to use interactive time series graph using dygraphs in R
Dygraphs refer to as Dynamic graphics which leads to an easy way to create interaction between user and graph. The dygraphs are mainly used for time-series analysis. The dygraphs package is an R interface to the dygraphs JavaScript charting library in R Programming Language.