Search code examples
rhighchartsr-highcharter

How to build an Organization Chart with highcharter


I want to plot an organization chart with highcharter (or, optionally, with another R highchart plotting library). I know that there are already some questions about that topic but they seem outdated since highchart now offers the possibility of organization chart.

Edit: Due to the responses of raf18seb (thanks a lot for you insights), I tried to download the github version and run some code that mirrors the sankey logic. However, no plot is rendered:

devtools::install_github("jbkunst/highcharter")
library(highcharter)

highchart() %>%
  hc_chart(type = 'organization') %>%
  hc_add_series(
    data = list(
      list(from = 'Brazil', to = 'Portugal'),
      list(from = 'Brazil', to = 'Spain'),
      list(from = 'Poland', to = 'England'))
  )

Solution

  • Thanks to the feature request by @raf18seb, currently we can build an organization chart as follows:

    devtools::install_github("jbkunst/highcharter", ref = "720")
    library(highcharter)
    
    highchart() %>%
      hc_chart(type = 'organization') %>%
      hc_add_series(
        data = list(
          list(from = 'Brazil', to = 'Portugal'),
          list(from = 'Brazil', to = 'Spain'),
          list(from = 'Poland', to = 'England'))
      )