Created
July 22, 2020 23:17
-
-
Save oneryalcin/d610b2240f77ddb8086b03195c9d22e6 to your computer and use it in GitHub Desktop.
highcharter example UK MAP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(highcharter) | |
library(dplyr) | |
mapdata <- get_data_from_map(download_map_data("countries/gb/gb-all")) | |
set.seed(1234) | |
data_fake <- mapdata %>% | |
select(code = `hc-a2`) %>% | |
mutate(value = 1e5 * abs(rt(nrow(.), df = 10))) | |
hcmap("countries/gb/gb-all", data = data_fake, value = "value", | |
joinBy = c("hc-a2", "code"), name = "Fake data", | |
dataLabels = list(enabled = TRUE, format = '{point.name}'), | |
borderColor = "#FAFAFA", borderWidth = 0.1, | |
tooltip = list(valueDecimals = 0, valuePrefix = "£", valueSuffix = " GBP")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment