Giter Site home page Giter Site logo

tdeenes / rchartsdygraphs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielkrizian/rchartsdygraphs

1.0 2.0 0.0 15.07 MB

An `rCharts` extension. Run `dygraphs` from R - interactive visualizations of time series using JavaScript and HTML canvas. See: http://dygraphs.com/ and

Home Page: http://rcharts.io/

rchartsdygraphs's Introduction

Installation

You can install rCharts from github using the devtools package

require(devtools)
install_github("rCharts","ramnathv")
install_github('rChartsDygraphs', 'danielkrizian')

Examples

library(rChartsDygraphs); library(quantmod); require(data.table)
getSymbols("SPY", from = "2001-01-01")

# candlestick
dygraph(data=SPY, legendFollow=T, candlestick=T)
dygraph(data=SPY, legendFollow=T) #autodetects is.OHLC(data)

# trade annotations (arrows)
data(trades)
dygraph(data=SPY[,"SPY.Close"], legendFollow=TRUE, trades=trades)

# relative performance
getSymbols("IBM", from = "2001-01-01", adjust=T)
dygraph(merge(IBM[,"IBM.Adjusted"], SPY[,"SPY.Adjusted"]), rebase="percent")

# color ribbon (highlight special events)
dydata=SPY[,"SPY.Close"]
colors = rep("transparent", NROW(dydata)) # must equal NROW(data)
colors[1000:1550] = "lightgreen" # accepts "#90EE90" representation too
colors[1700:2050] = "red"
colors[2060:2140] = "lightblue"
dygraph(data=dydata, ribbon=colors)
dygraph(data=dydata, ribbon=list(colors=colors, height=0.2, pos=0.1))

View interactive charts like this (link)

Zoom: mouse left-click & drag; Pan: Shift + mouse left-click & drag

<iframe src="http://rawgit.com/danielkrizian/rCharts_dygraphs/master/examples/multi-layout.html" style="width: 1200px; height: 900px;"/iframe>

rchartsdygraphs's People

Contributors

danielkrizian avatar timelyportfolio avatar jangorecki avatar

Stargazers

Linda Garami avatar

Watchers

James Cloos avatar Dénes Tóth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.