score:7
Accepted answer
Here you have a sample code:
library(highcharter)
highchart() %>%
hc_chart(type = 'organization', inverted = TRUE) %>%
hc_title(text = 'Highcharts Org Chart') %>%
hc_add_series(
name = 'Highsoft',
data = list(
list(from = 'Shareholders', to = 'Board'),
list(from = 'Board', to = 'CEO'),
list(from = 'CEO', to = 'CTO'),
list(from = 'CEO', to = 'CPO'),
list(from = 'CEO', to = 'CSO'),
list(from = 'CEO', to = 'CMO'),
list(from = 'CEO', to = 'HR'),
list(from = 'CTO', to = 'Product'),
list(from = 'CTO', to = 'Web'),
list(from = 'CSO', to = 'Sales'),
list(from = 'CMO', to = 'Market')
),
levels = list(
list(level = 0, color = 'silver', dataLabels = list(color = 'black'), height = 55),
list(level = 1, color = 'silver', dataLabels = list(color = 'black'), height = 55),
list(level = 2, color = '#980104'),
list(level = 4, color = '#359154')
),
nodes = list(
list(id = 'Shareholders'),
list(id = 'Board'),
list(id = 'CEO', title = 'CEO', name = 'Grethe Hjetland', image = 'https://wp-assets.highcharts.com/www-highcharts-com/blog/wp-content/uploads/2018/11/12132317/Grethe.jpg'),
list(id = 'HR', title = 'HR/CFO', name = 'Anne Jorunn Fjarestad', color = '#007ad0', image = 'https://wp-assets.highcharts.com/www-highcharts-com/blog/wp-content/uploads/2018/11/12132314/AnneJorunn.jpg', column = 3, offset = '75%'),
list(id = 'CTO', title = 'CTO', name = 'Christer Vasseng', color = '#007ad0', image = 'https://wp-assets.highcharts.com/www-highcharts-com/blog/wp-content/uploads/2018/11/12140620/Christer.jpg', column = 4, layout = 'hanging'),
list(id = 'CPO', title = 'CPO', name = 'Torstein Honsi', image = 'https://wp-assets.highcharts.com/www-highcharts-com/blog/wp-content/uploads/2018/11/12131849/Torstein1.jpg', column = 4),
list(id = 'CSO', title = 'CSO', name = 'Anita Nesse', image = 'https://wp-assets.highcharts.com/www-highcharts-com/blog/wp-content/uploads/2018/11/12132313/Anita.jpg', column = 4, layout = 'hanging'),
list(id = 'CMO', title = 'CMO', name = 'Vidar Brekke', image = 'https://wp-assets.highcharts.com/www-highcharts-com/blog/wp-content/uploads/2018/11/13105551/Vidar.jpg', column = 4, layout = 'hanging'),
list(id = 'Product', name = 'Product developers'),
list(id = 'Web', name = 'Web devs, sys admin'),
list(id = 'Sales', name = 'Sales team'),
list(id = 'Market', name = 'Marketing team')
),
colorByPoint = TRUE,
color = '#007ad0',
dataLabels = list(color = 'white'),
borderColor = 'white',
nodeWidth = 65
) %>%
hc_tooltip(outside = TRUE)
You can see the R structure. If you want to use JavaScript code in it, you can use JS() method. More examples of Highcharts in R (with JS() method) you can find in my StackOverflow profile in 'Answers' tab.
Let me know if you have further questions.
edit: some properties (like color) don't work in Highcharter wrapper. I suggest creating a GitHub ticket on Highcharter repo: https://github.com/jbkunst/highcharter/issues Maybe the author of the wrapper will know more.
Source: stackoverflow.com
Related Query
- How can we plot Highcarts organization chart in R language?
- How can I display a Highcharts organization chart with level 1 nodes below other level 1 nodes?
- The RTL language (Arabic) is not working with HighCharts pie chart correctly, how can I fix this?
- How can I get access to a Highcharts chart through a DOM-Container?
- how can I move yAxis labels from Right of chart to left of chart in highstock
- How can I use chart tooltip formatter in react-highcharts?
- Highstock: When legend under the chart has many items, the chart height is small. How can I fix the height?
- Highcharts - How can I remove starting and ending padding from area chart
- How can I update a total chart value in legendItemClick callback?
- Highcharts, How can I change the datalable distance in a pie chart based on the value
- How can I extend the lines of this Highchart series to the edges of my chart area?
- How can I prevent my HighChart bar chart from being inverted?
- How can i create doughnut chart using oxyplot in xamarin.android?
- How to build an Organization Chart with highcharter
- highcharts- stacked bar, how can I make the chart cover the width 100%?
- How can I add a Bar Chart to my Django based Database?
- How can I render full chart using PhantomJS?
- Can we create pie chart and scatter plot combined using highcharts.js?
- How can we add chart context menu in highcharts-angular?
- In Highcharts, how can we separatedly set up the border color of each block in a Pyramid chart
- How can I make milestone lines with a GANTT chart using the highcharts library?
- How can I display crosshair labels on top of the chart with Highcharts
- How can I get a chart only with legends using highcharts
- How can I get highcharts Donut chart to auto calculate percentages
- How can I show only one x-axis in synchronous chart highchart
- How can I reveal my chart tooltip programatically when the tooltip combines data from multiple series? (sync charts)
- How can I create a chart with stacked columns after drilldown?
- How to add horizontal scroll in Organization chart highcharts?
- In Highchart gantt Chart inside highcharts-point how can i create custom shapes
- how can we draw column chart with stacked column chart in a single high chart?
More Query from same tag
- Highcharts: why does redrawing change the radius of the selected point?
- Highcharts reset y Axis
- last label in x axis with datetime format not coming in highchart
- Highcharts gauge property
- Highcharts: Add point without connecting series
- Android Highcharts DialogFragment
- highcharts - is it possible to zoom pie charts
- Why does highchart not recognize my dates?
- How to import or load Dumbbell chart in react app
- Highcharts - Exporting gantt charts not showing previous interaction by user
- Display year in x axis of line graph highcharts
- Is it possible to change properties of xAxis.labels individually in HighCharts?
- Can I hide legend name in StackedChart using HighChart?
- Highchart: Center text in plot option in column chart
- Highmaps call JavaScript function when region is clicked
- DataLabels hide themselves even after allowOverlap is set to true. How to fix it?
- Node JS, Highcharts Memory usage keeps climbing
- Dynamically set click event on bar from highcharts graph
- How to style Highchart data table and make it responsive?
- Highcharts Timeline xAxis
- Browser crashes after periodic update of Highcharts series data
- Highcharts pointPlacement ignored in version 2.3.5
- How to access React hook state in Highcharts event listener
- Highcharts and Java: saving image on server side
- how to use tickInterval or step in the highcharts?
- Exclude a specific series from exporting to csv
- highcharts chart showing only last element in series
- hc_yaxis_multiple for add_series_list
- HighStock Chart don't display line for missing Y axis data
- Graph for data updated every 30 minutes