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

mapbubble creation with highcharter? #209

Closed
christopheLouat opened this issue Oct 28, 2016 · 5 comments
Closed

mapbubble creation with highcharter? #209

christopheLouat opened this issue Oct 28, 2016 · 5 comments

Comments

@christopheLouat
Copy link

Is it possible to create map with mapbubble series with highcharter? I have tried with a lot of dataset and I don't succed to create a chart. I can generate date for mappoints series but they don't work for mapbubble series. Can you tell me how to represent data?

@jbkunst
Copy link
Owner

jbkunst commented Oct 28, 2016

Hi @christopheLouat ,

Can you post 2 things? 1) What have you done/code? 2) Similar demo example from http://www.highcharts.com/maps/demo

Thanks

@christopheLouat
Copy link
Author

Hi @jbkunst

1)I have a dataset like this (dataTable)

code latitude longitude z
AAA 30.322500 -9.411388 1200
BBB 50.901390 4.484444 9120
CCC 25.252777 55.364445 41200

I have test the following code:
world <- "https://raw.githubusercontent.com/johan/world.geo.json/master/countries.geo.json" %>%
GET() %>%
content() %>%
jsonlite::fromJSON(simplifyVector = FALSE)

parksgjs <- geojson_json(dataTable, lat = "latitude", lon = "longitude")

highchart(type = "map") %>%
hc_title(text = "Most frequented place") %>%
hc_add_series(mapData = world,
nullColor = "#425668 ",
showInLegend = FALSE) %>%
hc_add_series(data = parksgjs , type = "mapbubble",
dataLabels = list(enabled = FALSE),

            minSize= 4,
            maxSize= 20
            ) %>%

hc_mapNavigation(enabled = TRUE,
buttonOptions = list(
align = "right",
verticalAlign = "bottom"))

i have test with the geojson transformation of the data and without but i don't have the expected result.
If I use the type mappoint (and geojson transformation of data) I can obtain a result but I prefer Bubble.

  1. http://www.highcharts.com/maps/demo/latlon-advanced

Thanks

@jbkunst
Copy link
Owner

jbkunst commented Nov 4, 2016

I'm working on this. I think I'll need to add some if in the case of this type of data.

@jbkunst jbkunst added this to the v0.5.0 milestone Dec 23, 2016
@jbkunst
Copy link
Owner

jbkunst commented Dec 23, 2016

Hi @christopheLouat !!!!

Uff, so much time but I worked on hcmap function and fix some details in the highcharts binding.

Try the following in the development version:

cities <- data_frame(
  name = c("London", "Birmingham", "Glasgow", "Liverpool"),
  lat = c(51.507222, 52.483056,  55.858, 53.4),
  lon = c(-0.1275, -1.893611, -4.259, -3),
  z = c(1, 2, 3, 2)
)

hcmap("countries/gb/gb-all", showInLegend = FALSE) %>% 
  hc_add_series(data = cities, type = "mapbubble", name = "Cities", maxSize = '10%') %>% 
  hc_mapNavigation(enabled = TRUE) # Zoom

image

hcmap("custom/world", showInLegend = FALSE) %>% 
  hc_add_series(data = cities, type = "mappoint", name = "Cities", maxSize = '1%') %>% 
  hc_mapNavigation(enabled = TRUE) # Zoom

image

@jbkunst jbkunst closed this as completed Dec 23, 2016
@christopheLouat
Copy link
Author

Hi Joshua!

thanks a lot for the corrections on the hcmap function. The bubble map is great!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants