web-dev-qa-db-ja.com

ハイチャーターでバブルマップをカスタマイズする

誰かが私にこの素晴らしいjsfiddleをhighcharterパッケージを使った「光沢のある」アプリケーションに実装するのを手伝ってくれませんか?
https://jsfiddle.net/BlackLabel/nr1y47a9/

私はこのようなものを書き始めましたが、まだいくつかの問題があります...
結果は次のとおりです: https://pasteboard.co/J7qWN7v.png

library(highcharter)
library(httr)
library(dplyr)

getContent <- function(url) {
  content(GET(url))
}
world <- getContent("https://cdn.jsdelivr.net/gh/highcharts/[email protected]/samples/data/world-population.json")

mapdata <- get_data_from_map(download_map_data("custom/world"))

hcmap("custom/world", showInLegend = FALSE) %>% 
  hc_add_series(name = "Countries", color = '#E0E0E0') %>%
  hc_add_series(data= world,type = "mapbubble", name = "Population", joinBy = c("iso-a3", "code3"), color= '#E0E0E0',
                minSize = 4, maxSize = "12%",
                tooltip = list(pointFormat = '{point.properties.hc-a2}: {point.z} thousands')) %>%
  hc_colorAxis(
    dataClasses = color_classes(c(0, 50000, 100000, 500000),
                                colors = c("green","#81c784","#43a047","#1b5e20")#,
                                # names = c("sg","tf","qsd")
    )) %>% 
  hc_legend(title = list(text = "Mon titre"),
            bubbleLegend = list(
              enabled = TRUE,
              borderColor = '#000000',
              borderWidth = 3,
              color = '#8bbc21',
              connectorColor = '#000000'
            ),
            align = "bottom", layout = "horizontal",
            verticalAlign = "bottom",
            floating = TRUE ,valueDecimals = 0,
            symbolHeight = 11, symbolWidth = 11, symbolRadius = 0,
            backgroundColor='#E0E0E8') %>% 
  hc_mapNavigation(enabled = TRUE) %>% 
  hc_exporting(enabled = TRUE) 

よろしくお願いします!

7
Damien Dotta

むしろ簡単な解決策ですが、このバグは開発版のハイチャーターには存在しません。

試す

remotes::install_github("jbkunst/highcharter")

bubbleplot

0
mnist