Comments (9)
Yep, it's in https://github.com/jbkunst/highcharter#future-work ;)!
from highcharter.
Just an update. I'm just implemented a highstock
parameter to get a Highstock instead of Highcharts. Works fine but it seems to be bugged the range selector and I need to do some test with real data via quantmod package.
You can check examples here: http://jkunst.com/highcharter/#time-series-highstock
from highcharter.
Great thank you.
So I see that it can handle ts objects
z <- ts(matrix(rnorm(300), 100, 1), start = c(1961, 1), frequency = 12)
highchart(highstock = TRUE) %>% hc_add_series_ts2(z, color = "#26838E")
How would I pass it an xts object?
ProdData <- xts(runif(100,0,1), seq(as.POSIXct("2016-01-04 08:00:00"), as.POSIXct("2016-01-04 08:01:00"), length = 100),tz="GMT")
Also, is type="candlestick" from highstock exposed?
from highcharter.
You pass an xts objects transforming the data, same as #8 (comment).
Theres no a function (like shorcut) to chart candlesticks in a quick way yet. Anyway, as same as all charts in highcharts/highstock you can replicate and make the options needes to plot. For example, if you want to chart this example http://www.highcharts.com/stock/demo/candlestick see the View options button.
Rebember, you can do everithing right know. The actual issue is you need transform your R data in jsonlike format (timestamps , in lists) to use them in highcharter. As I said you I'm working on shortcuts to chart quickly this objects ;)!
I can't run this example 100% because I have firewall issues in my work place. But something like this can work:
require("quantmod")
getSymbols("SPY", src = "google")
time <- time(SPY) %>%
zoo::as.Date() %>%
as.POSIXct() %>%
as.numeric() %>%
{ 1000 * . }
spy <- SPY[,-5] %>%
as.data.frame() %>%
{cbind(time, .)} %>%
list.parse2()
highchart(highstock = TRUE) %>%
hc_add_series(type = "candlestick",
data = spy,
name = "SPY",
dataGrouping = list(
units = list(
list("week", 1),
list("month", c(1,2,3,4,6))
)
)
)
from highcharter.
Awesome, I confirm it works.
To be able to combine this with the highcharts boost module would make it very useful
from highcharter.
Yep it's the idea use that module! Need time to test 😄
from highcharter.
http://jkunst.com/highcharter/#xts-objects-and-quantmod-package
Regards,
from highcharter.
Awesome, that is really great.
from highcharter.
I dont know if the module works on highsotck candlestick series (for example) But it was added:
http://rpubs.com/jbkunst/highcharter-no-boost
http://rpubs.com/jbkunst/highcharter-boost
Code:
n <- 50000
x <- sin(4*2*pi*seq(n)/n) + rnorm(n)/10
plot(x)
highchart() %>%
hc_title(text = sprintf("Drawin %s points", n)) %>%
hc_chart(zoomType = "x") %>%
hc_tooltip(valueDecimals = 2) %>%
hc_add_series(data = x, lineWidth = 0.5)
Sadly, I cant replicate de scatter example yet. With n = 4999 works, but with n = 5000 produce
highstock.js:252 Uncaught TypeError: Cannot read property 'length' of undefined
library("MASS")
# n <- 4999
n <- 5000
sigma <- matrix(c(10,3,3,2),2,2)
sigma
mvr <- round(mvrnorm(n, rep(0, 2), sigma), 4)
ds <- list.parse2(as.data.frame(mvr))
head(ds)
highchart() %>%
hc_xAxis(min = min(mvr[, 1]), max = max(mvr[, 1])) %>%
hc_yAxis(min = min(mvr[, 2]), max = max(mvr[, 2])) %>%
hc_chart(zoomType = "xy") %>%
hc_legend(enabled = FALSE) %>%
hc_add_series(data = ds,
type = "scatter",
color = 'rgba(152,0,67,0.9)',
marker = list(radius = 0.8),
tooltip = list(
followPointer = FALSE,
pointFormat = '[{point.x:.1f}, {point.y:.1f}]'
)) %>%
hc_plotOptions(series =
list(
turboThreshold = 5000,
enableMouseTracking = FALSE
)
)
This is related to issue #8
from highcharter.
Related Issues (20)
- Bugs in highcharter maps HOT 6
- defs to define gradient zones in styledmode
- Charts with `highchartOutput2` not rendering
- Feature Request: Add TiledWebMap module functionality / Upgrade Highcharter Version
- Drilldown breadcrumbs
- Installation issues witth the package highcharter HOT 4
- Timezone adjustment via time object, using hchart()
- deprecated function unite_()
- Upgarde to HighchartsJS 11.2.0
- Output valid JSON only
- hc_exporting converts plot to dark mode HOT 2
- Docker build fail HOT 2
- Different scales for different variables in polar charts HOT 1
- Highcharter under r-shinylive HOT 1
- hcaes_string() doesn't work due to conflicts with other packages HOT 1
- Pie chart onPoint option not working as expected on hcmap/Feature request: update highcharts
- Create wordcloud output like wordcloud2 output style
- Add title to `hw_grid`
- Feature: enable color sea / oceans option - hc_add_series
- in Maps, the dashed borders have a scaling issue when zooming in and which only disappears if you hover your mouse over the lines.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highcharter.