使用D3.js读取csv内容

csv文件(399905.XSHE.PEP.csv)预览:
399905.XSHE.PEP.csv

day,close,pe,pep,p20,p50,p80
2007-01-15,nan,46.59,0.00,46.59,46.59,46.59
2007-01-16,1986.53,47.81,50.00,46.83,47.20,47.57
2007-01-17,2055.01,47.30,33.33,46.87,47.30,47.61
2007-01-18,2035.65,49.31,75.00,47.02,47.55,48.41
2007-01-19,2085.40,51.01,80.00,47.16,47.81,49.65
2007-01-22,2159.63,52.88,83.33,47.30,48.56,51.01
2007-01-23,2258.98,52.63,71.43,47.40,49.31,52.31
2007-01-24,2261.78,53.23,87.50,47.50,50.16,52.78
2007-01-25,2283.69,50.72,44.44,47.61,50.72,52.73
2007-01-26,2174.23,51.02,60.00,47.71,50.86,52.68
2007-01-29,2186.27,52.39,63.64,47.81,51.01,52.63
2007-01-30,2260.59,52.34,58.33,48.11,51.02,52.58
2007-01-31,2255.93,49.75,30.77,48.41,51.01,52.53
2007-02-01,2142.89,50.96,42.86,48.71,50.98,52.49

html文件,ps:chrome现在貌似不支持file://协议,得用http://x.x.x.x/demo.html浏览
demo.html






参考:

https://github.com/d3/d3/wiki/CSV

http://blog.csdn.net/lzhlzz/article/details/39755649

你可能感兴趣的:(使用D3.js读取csv内容)