I want to create a bar and line chart with the dygraphs package. Like this: Bar & Line Chart Dygraph, or again, like this: Series plotter in this page but I can't find the dyBarSeries
function.
I managed to plot bar plot with the rangeselector
with the dygraphs package, by creating the function (the .js is in the package, it was enough to indicate the path to the function) but impossible to find the function for the bar & line chart.
Someone already had the same problem? I really need help, thanks in advance.
Here is the complete code:
Packages I use and functions I create: I wish I could do the same thing for DyBarSeries (or another form of chart) but I can not find the .js
library(TTR)
library(stringr)
library(dygraphs)
library(xts)
library(zoo)
library(ggplot2)
library(plotly)
dyBarChart <- function(dygraph) {
dyPlotter(dygraph = dygraph,
name = "BarChart",
path = "/Library/Frameworks/R.framework/Versions/3.4/Resources/library/dygraphs/examples/plotters/barchart.js")
}
dyMultiColumn <- function(dygraph) {
dyPlotter(dygraph = dygraph,
name = "MultiColumn",
path = "/Library/Frameworks/R.framework/Versions/3.4/Resources/library/dygraphs/examples/plotters/multicolumn.js")
}
After, I build my file, but it's not interesting here. For the graphic my data is organized like this:
Sommeil EMA
2017-11-07 10 0.000000
2017-11-20 5 0.000000
2017-11-25 8 0.000000
2017-11-27 10 0.000000
2017-11-28 10 0.000000
2017-12-01 4 0.000000
2017-12-10 5 7.428571
2017-12-15 6 7.071429
2018-01-08 2 5.803571
This line works but I end up with a multibarchart :
test <- dygraph(playerF) %>%
dyRangeSelector() %>% dySeries("EMA", color = rgb((161/255), (94/255), (27/255), 0.80)) %>% dySeries("Sommeil", color = rgb((40/255), (94/255), (27/255), 0.80)) %>% dyMultiColumn() %>% dyUnzoom
test