How to populate a bar chart from an array of objects

0 Answers 216 Views
Charts
Aaron
Top achievements
Rank 1
Iron
Aaron asked on 01 Aug 2022, 04:02 PM

I have an array of objects I'm looking to build a stacked bar chart on,  the challenge I have is the number of stackable bars has to be variable. My data currently comes in looking like this:

 

            "agentServices": [
              {
                "servicesPerformed": 1,
                "agentId": "083a2039-bffb-4c15-9ae6-be2f4dce47ec",
                "serviceId": "8293f890-6e96-4e2e-b1c8-6879c9434024",
                "firstName": "SAMPLE",
                "lastName": "TEST"
              },
              {
                "servicesPerformed": 1,
                "agentId": "083a2039-bffb-4c15-9ae6-be2f4dce47ec",
                "serviceId": "c3453213-90d8-4aac-9473-f8b214dfb608",
                "firstName": "SAMPLE",
                "lastName": "TEST"
              }
            ]

 

I'm looking to chart the count of services performed(length of a bar stack), per service(number of stacked bars) per agentID(number of separate bars) the number of services available is end user defined, so I assume I need some sort of looping to account for that since I can't just static code a set amount of series items to account for that.

my end goal is something like this, but with more then just 2 services

No answers yet. Maybe you can help?

Tags
Charts
Asked by
Aaron
Top achievements
Rank 1
Iron
Share this question
or