How to draw vertical Bars with dygraphs

373 views Asked by At

I use R implementation of dygraphs to generate interactive charts in R. By default, it plots line chart of supplied data. However I would like to have vertical bars instead of line chart for below data -

library(dygraphs)
dygraph(mdeaths)

Appreciate if someone can give me any pointer to implement the same, as I failed to find any option to do the same.

2

There are 2 answers

2
Ronak Shah On

Try dyBarChart

library(dygraphs)
dyBarChart(dygraph(mdeaths))

enter image description here

0
cyperpunk On

Try with Dygraphs plotters plugin. Have a look at below links for the implementation of Dygraphs Bar Chart implementation.

https://github.com/danvk/dygraphs/blob/master/tests/plotters.html#L97 http://dygraphs.com/tests/plotters.html

Maybe it can help you.