Forum Academy Marketplace Showcase Pricing Features

Google Charts - Structure Data

Hello all,

i got a doozy for you, so i am trying to run google charts in an HTML block, so far so good (using iframe options & though able to have dynamic heights). In this example i am trying to user the org structure found here https://developers.google.com/chart/interactive/docs/gallery/orgchart

As you see from the example below i have already built the block and added it to the page (static at this point). I have also setup my data structure to always show the supervisor / manager. This way i can cycle through the records till i reach the GM or CEO.

So the question is how i can i structure the data structure dynamically and cycle through the supervisor / manager field to the the next line of code below. currently the HTML code looks like this

          [{v:'GM', f:'Oliver Woodsmansee<div style="color:grey; font-style:italic">General Manager</div>'},
           '', 'General Manager Transport Group'],
          [{v:'OM', f:'Shailaja Shetty<div style="color:grey; font-style:italic">Operation Manager</div>'},
           'GM', 'EK-Operation Manager'],
          [{v:'RPS', f:'Mohammed Ali<div style="color:grey; font-style:italic">R&P Superintendent</div>'},
           'OM', 'Resource & Planning'],
          [{v:'CM', f:'Ali Farahat<div style="color:grey; font-style:italic">EK Contract Manager</div>'},
           'GM', 'EK Contract Manager'],
          [{v:'OF', f:'Shabir<div style="color:grey; font-style:italic">R&P Officer</div>'},
           'RPS', ''],
          [{v:'YOU', f:'<div style="color:red">Your Name</div> <div style="color:red; font-style:italic">Your Position</div>'},'OF', ''],

Any and all ideas are welcome