amcharts / dataloader

Apache License 2.0
25 stars 25 forks source link

remove the last empty Array element in AmCharts.CSVToArray parse result. #10

Open iamchenxin opened 9 years ago

iamchenxin commented 9 years ago

i only modified dataloader.js ,do not modified dataloader.min.js . this problem is mainly caused by the last delimiter,many program,like libreoffice export csv with LF at the last end line.

the CSV in dataloader's examples is ended like this

Date,Open,High,Low,Close,Volume,Adj Close LF 2000-01-04,113.56,117.12,112.25,112.62,54119000,40.86 LF 2000-01-03,117.38,118.62,112.00,116.56,53228400,42.29

but csv file exported by some program like libreoffice is ended in this form

Date,Open,High,Low,Close,Volume,Adj Close LF 2000-01-04,113.56,117.12,112.25,112.62,54119000,40.86 LF 2000-01-03,117.38,118.62,112.00,116.56,53228400,42.29 LF

so in this case dataloader will genarate a element like [""] in the end of the array(arrData). This will lead incorrect data display at later processs.

martynasma commented 9 years ago

Thanks. Before we merge this pull, can you send an example of such document so we can test?

You can send it to contact@amcharts.com