Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Candlestick plotter #128

Merged
merged 7 commits into from
Nov 1, 2016
Merged

Candlestick plotter #128

merged 7 commits into from
Nov 1, 2016

Conversation

przmv
Copy link
Collaborator

@przmv przmv commented Sep 4, 2016

This PR introduces the dyCandlestick function to render Candlestick/OHLC chart with dygraphs:

library(xts)
data(sample_matrix)
library(dygraphs)
dygraph(sample <- matrix) %>%
  dyCandlestick()

and the output is the following:
candlestick

This PR implements some features discussed in #3
CC: @danielkrizian

@renkun-ken
Copy link
Contributor

Looks nice!

@jjallaire
Copy link
Member

Does this impose any requirements on the input data (e.g. number of series). If so perhaps the function should validate that and throw an error if the data isn't as required.

@przmv
Copy link
Collaborator Author

przmv commented Oct 29, 2016

@jjallaire it checks for the number of series on the JavaScript side, i.e. if the number of series is lesser than four it switches back to line plotter, otherwise if the amount of series is greater than four it plots the first four series with candlestick plotter and the rest with line plotter.
2016-10-29-064734_666x344_scrot

@jjallaire
Copy link
Member

@pshevtsov This is looking great. I've moved the documentation into the docs/ folder. Could you add a page about the candlestick plugin? You just need to create an Rmd (e.g. "gallery-candlestick.Rmd") in the fashion of the other ones then add a link to it from the sidebar (https://github.com/rstudio/dygraphs/blob/master/docs/include/before_body.html)

@przmv
Copy link
Collaborator Author

przmv commented Oct 31, 2016

@jjallaire Sure thing! BTW, how should I generate html file from that Rmd one?

@jjallaire
Copy link
Member

Just call rmarkdown::render_site within the docs directory

On Mon, Oct 31, 2016 at 9:45 AM, Petr Shevtsov [email protected]
wrote:

@jjallaire https://github.com/jjallaire Sure thing! BTW, how should I
generate html file from that Rmd one?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#128 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGXx7_-jdsJkvEvddzxJcLzazUtcA5Oks5q5fEUgaJpZM4J0bSy
.

@przmv
Copy link
Collaborator Author

przmv commented Oct 31, 2016

@jjallaire Ready. I decided not to commit generated *.html files, since the output seems to be system dependent and the diff with the upstream was huge.

@jjallaire jjallaire merged commit de46fd7 into rstudio:master Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants