Can't replicate "Export data to csv" example

Try taking a look at this working example on another thread: Save plot data as csv