Skip to main content
Answer

Can I create a color-coded org chart using API import in Lucid?

  • June 18, 2025
  • 3 replies
  • 51 views

Forum|alt.badge.img+4

I would like to create a color-coded organizational chart using the standard import feature of the API, but the generated organizational chart does not have any colors. Could you please tell me the reason? The content of the JSON is as follows:

 

{
  "version": 1,
  "product": "lucidchart",
  "pages": [
    {
      "id": "page1",
      "title": "Org Chart Example",
      "dataBackedShapes": [
        {
          "id": "orgChart1",
          "type": "orgChart",
          "position": {
            "x": 150,
            "y": 150
          },
          "collectionId": "org-chart-data",
          "idField": "EmployeeID",
          "foreignKeyField": "SupervisorID",
          "nameField": "FullName",
          "roleField": "Role",
          "extraFields": [
            "Department",
            "Topping"
          ],
          "fill": {
            "type": "color",
            "color": "#800080"
          },
          "stroke": {
            "color": "#6f2131",
            "width": 3,
            "style": "solid"
          },
          "rounding": 10,
          "fieldStyles": {
            "EmployeeID": {
              "fill": {
                "type": "color",
                "color": "#FFCC00"
              }
            },
            "FullName": {
              "fill": {
                "type": "color",
                "color": "#00FF00"
              }
            },
            "Role": {
              "fill": {
                "type": "color",
                "color": "#0000FF"
              }
            },
            "Department": {
              "fill": {
                "type": "color",
                "color": "#FFA500"
              }
            },
            "Topping": {
              "fill": {
                "type": "color",
                "color": "#FF69B4"
              }
            }
          }
        }
      ]
    }
  ],
  "collections": [
    {
      "id": "org-chart-data",
      "dataSource": "org-chart-data.csv"
    }
  ]
}

Best answer by Trevor J

Hi Shu,

Org charts imported through the API don’t support any sort of style fields, so unfortunately there’s no way to add this programmatically. All valid fields are defined here: Data Backed Shapes

Could you tell us more about the workflow you are building? This would help us prioritize adding support for styles in the future.

Comments

Forum|alt.badge.img+3
  • Lucid product team
  • Answer
  • June 18, 2025

Hi Shu,

Org charts imported through the API don’t support any sort of style fields, so unfortunately there’s no way to add this programmatically. All valid fields are defined here: Data Backed Shapes

Could you tell us more about the workflow you are building? This would help us prioritize adding support for styles in the future.


Forum|alt.badge.img+4
  • Author
  • June 30, 2025

I am trying to create an organizational chart using the API. I believe it would be very convenient if we could add color coding or similar features.


Michael B
Forum|alt.badge.img+4
  • Lucid product team
  • June 30, 2025

Thanks Shu,

We agree that there is room for improvement with the org chart (and hierarchys in general). I have passed on your feedback for future consideration. We do not have an ETA for when these improvements will happen.