Dynamic series in a perspective XYChart

I’m trying to show multiple lines of data on a single graph. I’m dynamically generating a dataset with columns t_stamp, val1, val2, etc… and that’s pulling in fine. I can show multiple lines if I manually configure a number of array elements in series, but that doesn’t allow for building it dynamically.

Is there some documentation on using a script to edit json arrays? I can’t seem to figure that part out.