How to set highchart global options IN R
highcharts set series data dynamically
highcharts options typescript
highcharts series options
highcharts hello world
Here is the api link: http://api.highcharts.com/highcharts#global
I am trying to set "timezoneOffset" and I have tried many different ways.
When I do this in R:
I do not get any warning or error, but it's not working.
Thanks a lot for the help!
Here is a piece of code:
library(rCharts) highChart <- Highcharts$new() highChart$global(timezoneOffset=-300) highChart$chart(zoomType = "xy") highChart$exporting(enabled = T) highChart$xAxis(type="datetime",list( title = list(text = "Time"))) highChart$yAxis(list ( list(title = list(text = "Variance")) )) highChart$series(data=list(c(x=1407795845000,y=1),c(x=1407795846000,y=2),c(x=1407795847000,y=3))) highChart
As you can see, the timezoneOffset is not working when I run this piece of code and the time is still displayed in GMT.
The highcharter options can be accessed, but they are set inside the standard R options under the list element
highcharter.options. They are not given directly to the highchart, and inside
highchart(), there is the code line
opts <- getOption("highcharter.options", list()).
I don't think there is another way than just get the options, alter whatever options you need to change and then set the options again with your additions.
The following is a simple illustration:
library(highcharter) # normal highchart highchart() %>% hc_add_serie_labels_values(1:901, seq(1, 10, 0.01)) opts <- getOption("highcharter.options") opts$lang$decimalPoint <- "." options(highcharter.options = opts) # now with "," instead of "." (confirm in tooltip) highchart() %>% hc_add_serie_labels_values(1:901, seq(1, 10, 0.01))
Of course in your case, you need to set the
As of version 0.5.0 of
highcharter, it seems the option
highcharter.options is not there any more, but there are several separate options, e.g.
highcharter.global, etc. So the following approach works:
lang <- getOption("highcharter.lang") lang$decimalPoint <- "," lang$numericSymbols <- highcharter::JS("null") # optional: remove the SI prefixes options(highcharter.lang = lang)
In addition to changing the decimal point, the SI prefixes ("k", "M", "G", etc.) are turned off by setting the numericSymbols to null, see Replacing/removing the metric notations like thousands "k" abbreviation.
set the globalOptions in the Highcharts String, Hi, I'm running a local Highcharts Export Server based on Java and PhantomJS to render the HighCharts in the Jasper Report. I built some The highcharter package enables the creation of Highcharts type plots within R. There are two main functions in the package: highchart(): Creates a Highchart chart object using htmlwidgets. The widget can be rendered on HTML pages generated from R Markdown, Shiny, or other applications.
First you have to switch of the
useUTC flag to
FALSE. Than you can set the
timezoneOffset as you wish and save the options back.
global <- getOption("highcharter.global") global$useUTC <- FALSE global$timezoneOffset <- -300 options(highcharter.global = global)
For better understanding make sure you take a look at global:
Set Options: Comma Separator · Issue #69 · jbkunst/highcharter , highchart() 'hc_opts' doesn't seem to implement languages, particularly: Highcharts. Or like you set global options for DT package with DT.options argument it's described here https://rstudio.github.io/DT/options.html in 3. In Highcharts it's quite clear how to disable useUTC, docs with sample. In highcharter, it looks like you should add your comment to this ticket. It's about setting global options in Highcharter. – Paweł Fus Sep 19 '17 at 12:24
[PDF] Package 'highcharter', shortcut functions to plot R objects. 'Highcharts' String to define how to save the configuration options. One of 'is' Create a highchart object from a particular data type. Description hcmap(map = "custom/world",. Options Settings Description. options allows the user to set and examine a variety of global ``options'' which affect the way in which R computes and displays its results. Usage options() getOption(x) .Options Arguments
highcharter package, A wrapper for the 'Highcharts' library including shortcut functions to plot R objects. 'Highcharts' is a hc_rangeSelector, Setting scrollbar options to highstock charts. hc_scrollbar, Setting worldgeojson, World map in Geojson format (list). Options Settings Description. Allow the user to set and examine a variety of global options which affect the way in which R computes and displays its results.. Usage options() getOption(x, default = NULL) .Options
- Are you using an R package that you are not naming?
- @SebastianBochan I have updated the code. Thanks for your time.
- @BondedDust I am using rCharts package