简体   繁体   中英

dygraph equivalent for highcharts area range charts

I prefer dygraphs over highchart graphs as interative javascript graphs, so I was wondering is there a dygraph equivalent for the highcharts area range graphs ( http://www.highcharts.com/demo/arearange ) as is suggested in the link?

I have looked through the examples and documentation here ( http://dygraphs.com/ ), but not sure I can see anything that fits this.

As always any help here would be much appreciated.

Kindest regards,

HLM

I was originally using R to do this...and have implemented a version that carries out the range

# range areas...
library(quantmod)
library(dygraphs)

getSymbols(c("MSFT", "HPQ"), from = "2014-06-01", auto.assign=TRUE)

stocks <- cbind(MSFT[,"MSFT.Close"]-10,HPQ[,"HPQ.Close"])
colnames(stocks) <- c('A','B')

stocks$A_low <- NA
stocks$B_low <- NA

stocks$A_high <- stocks$A
stocks$B_high <- stocks$B

stocks[stocks$A>stocks$B,'B_low'] <- stocks[stocks$A>stocks$B,'B']
stocks[stocks$A>stocks$B,'A_low'] <- stocks[stocks$A>stocks$B,'B']

stocks[stocks$A<stocks$B,'B_low'] <- stocks[stocks$A<stocks$B,'A']
stocks[stocks$A<stocks$B,'A_low'] <- stocks[stocks$A<stocks$B,'A']


dygraph(stocks, main = "A vs B Share Prices") %>% 
  dySeries(c("A_low", "A", "A_high"), label = "A") %>%
  dySeries(c("B_low", "B", "B_high"), label = "B")

The bottom chart on the SF vs. NY temperatures example does something like this. You want to use customBars .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM