score:0
after further investigation, and following a post and answer by the person maintaining the package, @jbkunst, there is a fix that requires to pull the latest version of the package.
this is the code:
remotes::install_github("jbkunst/highcharter")
additional information is available at this link:
https://github.com/jbkunst/highcharter/issues/741
edit:
this is no longer true, when you download the updated version of the package from jbkunst's github repository, the package works with flexdashboard
as well.
however, please note that for my specific problem, which was embedded in the production of a flexdashboard
, pulling the latest version of the package seems to introduce an error whereby the first plot appears properly, and the following plots do not. this error is not consistent, so it may or may not occur on your end. i have added a post on the github page for the package, with a functional example if you're interested:
edit: this issue has been resolved https://github.com/jbkunst/highcharter/issues/744
in order to solve this issue for my specific case, i pulled the newest version of the package, then saved the map data as an excel file for all the maps i needed. i then relied on the json versions, which do work, to produce the maps: here's an example with tiles:
library(highcharter)
library(tidyverse)
library(jsonlite)
library(httr)
library(readxl)
de_map_js <- read_excel("your path/map.xlsx") # opening js map from excel
map_data <- as_tibble(data.frame(name = de_map_js$name,
values = sample(c(50:200), 16, replace = t))) # creating fake data by region for germany
de_map <- "https://code.highcharts.com/mapdata/countries/de/de-all.geo.json" %>% #downloading the german map as json
get() %>%
content()
highchart(type = "map") %>%
hc_title(text = "title") %>%
hc_subtitle(text = "subtitle") %>%
hc_add_series_map(map = de_map, df = map_data, joinby = "name", value = "values", # map = json map ; df = data.frame with correct region names ; values = your data values
datalabels = list(enabled = true
,format = "{point.properties.hc-a2}") # adding region initials on map
) %>%
hc_coloraxis(stops = color_stops(colors = viridislite::rocket(213, direction = -1,
begin = 0.2,
end = 1))) %>%
hc_mapnavigation(enabled = true)
and here's an example with city bubbles:
library(highcharter)
library(tidyverse)
library(jsonlite)
library(httr)
library(readxl)
df_fake <- data.frame(
name = c("cologne"),
lat = c(50.9375),
lon = c(6.9603),
z = c(1)
) # creating fake tile data
df <- data.frame(
name = c("berlin", "frankfurt", "munich", "cologne"),
lat = c(52.5200, 50.1109, 48.1351, 50.9375),
lon = c(13.4050, 8.6821, 11.5820, 6.9603),
z = c(1000, 500, 750, 1250)
) # creating bubble map series
de_map_json <- "https://code.highcharts.com/mapdata/countries/de/de-all.geo.json" %>% #downloading the german map as json
get() %>%
content()
highchart(type = "map") %>%
hc_add_series_map(map = de_map_json, df = df_fake, joinby = "name", value = "z") %>% # the fake data goes into the map generation, with the real map as json
hc_add_series(
data = df, # here you can add your data
type = "mapbubble", # the type of plot
name = "city",
minsize = "1%",
maxsize = "5%",
tooltip = list(
pointformat = "{point.name}: {point.z:,.0f}" # hover options
)) %>%
hc_mapnavigation(enabled = true) %>%
hc_coloraxis(stops = color_stops(colors = viridislite::turbo(10, begin = 0.4, end = 0.9))) %>%
hc_title(text = "title")
this was all achieved by savings the js maps as excel from the newer version of the package (see above), deleting and reinstalling the old version of the package, and finally generating the maps using json data instead of js.
all maps can be found here:
score:1
you can try importing this script from highcharts js api and see if it works correctly then. here you can find an article explaining how to work with js in r: https://www.highcharts.com/blog/tutorials/working-with-highcharts-javascript-syntax-in-r/?fbclid=iwar1o6hxeq21kq3c8twvxkjjoqs2xbaxy3ai2j3dk86c6lyqcvetnx_kvhfa
Source: stackoverflow.com
Related Query
- Getting Trailing Garbage error when loading maps from Highcharter in R
- R Highcharter Map Error - Parse Error Trailing Garbage
- highcharts organization chart is throwing error when loading module
- Getting "Highcharts error #17" when creating histogram (using Highcharts with Angular 6)
- Issues using highcharts node export server from ClojureScript - "0x03 error when performing chart generation"
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- Getting weird error message from Highstock / Highcharts
- Highcharts - Highcharter in R - Getting Tooltip values from df rather than map
- Highcharts error loading maps plugin
- Getting error when using angular2-highcharts in angular2 project
- Highcharts: making series disabled by default when loading data from CSV
- Why does my Highchart look different when I transfer my code from Jsfiddle to my server?
- Highcharts column chart, disable interpolation when loading from data table
- clear cache from Highchart when loading data from a json file
- I'm getting this error when fly over the chart: TypeError: Cannot read property 'lineWidth' of undefined
- Getting value from tooltip when hover on svg element on the graph created with highcharts
- Getting numbers on Y-axis to show up as percentages with code from a Highcharts code generator tool?
- Bars does not show up when loading JSON encoded data from PHP in Highcharts
- getting 0x03 error when performing chart generation: please check your input data in Highchart
- Upgrading highcharts version from 4.1 to 7.12 getting error Uncaught ReferenceError: Highcharts is not defined
- Error from Jenkins when a tooltip is on a dot highchart
- Highchart Pie Chart shows "slice 0.0%" when loading data from csv
- Receiving "Highcharts is not defined" error when using maps (Highmaps / Highcharts)
- Highcharts data loading from a JSON file error in setting up datetime
- Getting error when try to use external parameter to generate chart
- Server side chart .svg export with Highcharts and PhantomJS, error loading data from .csv file
- Highcharts => Getting the id of a point when clicking on a line chart
- Getting error while using highcharts in Angular 7
- JavaScript error when using Highcharts
- getting error#17 from highcharts while using solid gauge from backbone rails
More Query from same tag
- Is there a way to get superscripts to show up in highchart exports
- Highcharts styledMode with highcharts.css import causes pie legend hover to apply to all legend items
- Highcharts.js not working inside slick slider
- How can you speed up the Highcharts network graph initial animation?
- Highcharts dynamic stacked area
- How to add extra tears(ticks) in highcharts?
- Highcharts data value from variable array string
- Highcharts angular gauge: multiple dials with different colors
- Legend and Axis titles not showing in Highcharts Graph
- Highmaps View data table - Export-data.js
- Set at the same level the unit of two yaxis highcharts
- How to generate discontinuous timeline in highcharts?
- Django Passing arguments to linked .js script template
- Define a Global Custom Formatter for Highcharts
- HighCharts uncaught exception
- use jquery function in a highcharts
- Cannot find name 'require'
- How center the value 0[threshold], the line which separates positive and negative value?
- How can I update two highcharts with one dropdown menu?
- How to make histogram from already aggregated data?
- Heatmap 0 data values are not aligned properly
- Trying to design with highChart but colors are not showing up
- highcharts exporting - Java approach, maxWait property
- Start chart from threshold
- Highcharts - programmatically "flip" (reverse) Y Axis
- touch event support in highchart for iphone/ipads or any touchable devices
- How to set Highcharts labels width to 50%
- Mongodb + Stacked Highcharts
- highcharts - how do I do custom labels on heatmap legend
- Passing JSONArray to JQuery outputs Object