Using a CSV file as a datasource for XYChart

Hello everyone,
I have a CSV file and I want to use it as a datasource for my XYChart.
I have searched in docs.inductiveautomation and I found that it could be possible by scripting.
Is there anyone who can help me do this in detail?
Thanks

Maybe this will help,