Plot / display Galapagos Fitness as Polyline / live graph

I am running a Galapagos optimization for a study project. I would like to create a video by recording the rhino viewport while it’s running.

I want to use a Polyline as a live graph. It should display the fitness similar to the Galapagos window but just as a simple line to visualize the progress better. I dont really know how to go about this.

All I’ve found is the “data recorder” to record the current fitness while running the optimization. I would then use the data recorded as z values when constructing points.

Has anyone maybe done this before and/ or can help me out?

This is how I would want it to look like (red line):

Ive solved my problem. for anyone interested, here’s how I did it:

I used the data recorder to record the fitness values. I then constructed points using the fitness as the z value. I didn’t want to overcrowd the graph so I only used 50 datapoints spaced out equally throughout the dataset. The x value distance is the graphs length / 50 so that they’re spread out evenly. It would be even better if the z value is the average of the points directly above and below it but the current solution is enough for my needs.