I'm trying to feed a csv file into Chart.js using Papa Parse. I tried to define the result from Papa Parse as a global array, but I found two following examples I'm confused with.
<!doctype html>
<html>
<script src=https://cdnjs.cloudflare.com/ajax/libs/PapaParse/4.6.3/papaparse.min.js>
</script>
<script src=https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js>
</script>
<script>
var helloworld=Papa.parse("1,2,3,4,5").data;
document.write(JSON.stringify(helloworld));
</script>
</html>
This code works well, so I tried to tune it to feed a csv file.
<!doctype html>
<html>
<script src=https://cdnjs.cloudflare.com/ajax/libs/PapaParse/4.6.3/papaparse.min.js>
</script>
<script src=https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js>
</script>
<script>
var helloworld=Papa.parse("csv.csv",{download:true}).data;
document.write(JSON.stringify(helloworld));
</script>
</html>
I thought I did the same thing as the csv.csv file contains just the five numbers separated by commas, but the code printed nothing. Which part do I need to correct? Thank you.