'How to center a Highcharts Organization Chart
I'm trying to use highcharts' organization chart to display a company's organization hierarchy however, I'm having difficulty centering the chart inside of the highcharts container. It's always right justified by default. How can I center the chart?
My code:
chartOptions = {
title: {
text: "Organization Chart",
},
chart: {
type: "organization",
inverted: true,
},
series: [
{
name: "my company",
keys: ["from", "to"],
states: {
hover: {
brightness: -0.3,
},
},
data: this.projectData.organizationSchema,
levels: [
{
level: 0,
color: "#8B93AB",
dataLabels: {
color: "black",
},
height: 25,
},
{
level: 1,
color: "#8B93AB",
dataLabels: {
color: "black",
},
height: 25,
},
{
level: 2,
color: "#0267B0",
},
{
level: 4,
color: "#0267B0",
},
],
nodes: this.projectData.organizationNodes,
colorByPoint: false,
color: "#007ad0",
dataLabels: {
color: "white",
},
borderColor: "white",
width: 30,
height: 30,
borderRadius: 15,
},
],
};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
