danielkrizian / rChartsDygraphs

An `rCharts` extension. Run `dygraphs` from R - interactive visualizations of time series using JavaScript and HTML canvas. See: http://dygraphs.com/ and
http://rcharts.io/
9 stars 10 forks source link

Continuous red ribbon problem #16

Closed hetong007 closed 10 years ago

hetong007 commented 10 years ago

I use the following code to try the ribbon feature:

getSymbols("SPY", from = "2001-01-01")
difference = SPY[,"SPY.Open"]-SPY[,"SPY.Close"]
decreasing = which(difference<0)
increasing = which(difference>0)

colors = rep("transparent", nrow(dydata))
colors[decreasing] = "red"
colors[increasing] = "green"

dydata=SPY[,"SPY.Close"]
dygraph(data=dydata, ribbon=list(colors=colors, height=0.05, pos=0.02))

The result looks like: 1.png

I zoomed in: 2.png

Notice the last part of the ribbon stays red.

I tried to change the height and pos of ribbon but didn't help.

This appears in my firefox, chrome and RStudio viewer.

danielkrizian commented 10 years ago

Thanks for reporting. I was able to reproduce it and filed it here: https://github.com/danielkrizian/dygraphs/issues/18

It is not related to either height or position parameter. If looked closely on the right side of the ribbon while panning slowly to the right, there are traces of correct colors on the bottom pixel row of the ribbon, but they are overlaid with incorrect (red) color

przmv commented 10 years ago

Thanks for the reporting! The fix for Dygraphs Ribbon plugin was applied and the corrected version is available at http://danielkrizian.github.io/dygraphs/

danielkrizian commented 10 years ago

@hetong007 , I merged the ribbon fix (thx Petr) into master, should work now if you reinstall.

hetong007 commented 10 years ago

@danielkrizian That's perfect. Thank you!