I am trying to setup an org chart using Highcharts, but I am having trouble finding a good working example.
I am trying to implement something like this:
https://www.highcharts.com/demo/highcharts/organization-chart
My data looks like this:
I can paste in the JSON from the Highcharts site, and it works, but when I try to sub in getColumn-style placeholders pointing to my dataset, things get a little weird (e.g. all level1 values report to all level0 values instead of each having its own reporting lines).
What I am starting to suspect is that I either have:
- My input data is not setup correctly (i.e. I have a wide-short table instead of a narrow-long table).
- There is some iterative code that is missing.
If somebody had a simple working example of both the JSON and what the dataset looks like, it would be great to see this so that I can figure out what I am doing wrong and where. Alternately, any help at all would be greatly appreciated.
Thanks,
Ray
Here is my chart code:
{
"chart": {
"type": "organization",
"inverted": true
},
"title": {
"text": "Highcharts Organization Chart"
},
"series": [
{
"type": "organization",
"name": "Highsoft",
"keys": ["from", "to"],
"data": [
[["unique", ["getColumnFromGroupBy", 1]],["unique", ["getColumnFromGroupBy", 2]]],
[["unique", ["getColumnFromGroupBy", 2]],["unique", ["getColumnFromGroupBy", 3]]]
],
"levels": [
{
"level": 0,
"color": "silver",
"dataLabels": {
"color": "black"
},
"height": 25
},
{
"level": 1,
"color": "silver",
"dataLabels": {
"color": "black"
},
"height": 25
},
{
"level": 2,
"color": "#980104"
},
{
"level": 4,
"color": "#359154"
}
] ,
"colorByPoint": false,
"color": "#007ad0",
"dataLabels": {
"color": "white"
},
"borderColor": "white",
"nodeWidth": 65
}
],
"tooltip": {
"outside": true
},
"exporting": {
"sourceWidth": 1800,
"sourceHeight": 1600
}
}