Hi Robert,
If I understood the case correctly, I would suggest the below steps
Steps to follow:
1) Create a Structure with required attributes. Let's call it ChartData
2) Create a Local Variable of ChartData List Type. Let's name it DataList

3) Use the JSONSerialize action flow node to serialize the list of records i.e DataList to convert it into array of JSON objects

4) Create an input parameter of Text data type to the JS node and map the same serialized JSON output value (point 3) to it.
Hope this helps you!
Kind regards,
Benjith Sam