charts - Highcharts - how change JSON to csv -
i have small problem...
$(function () { $.get('../../../abc-test.csv', function(data) { // split data set ohlc , volume var ohlc = [], volume = [], datalength = data.length, // set allowed units data grouping groupingunits = [[ 'week', // unit name [1] // allowed multiples ], [ 'month', [1, 2, 3, 4, 6] ]], = 0; (i; < datalength; += 1) { ohlc.push([ data[i][0], // date data[i][1], // open data[i][2], // high data[i][3], // low data[i][4] // close ]); volume.push([ data[i][0], // date data[i][5] // volume ]); } $('#test').highcharts({ rangeselector: { selected: 1 }, title: { text: 'aapl historical' }, yaxis: [{ labels: { align: 'right', x: -3 }, title: { text: 'ohlc' }, height: '60%', linewidth: 2 }, { labels: { align: 'right', x: -3 }, title: { text: 'volume' }, top: '65%', height: '35%', offset: 0, linewidth: 2 }], data: { csv: data //csv: document.getelementbyid('csv').innerhtml }, series: [{ type: 'candlestick', name: 'aapl', data: ohlc, datagrouping: { units: groupingunits } }, { type: 'column', name: 'volume', data: volume, yaxis: 1, datagrouping: { units: groupingunits } }] }); }); });
abc-test.csv:
date,open,high,low,close,volume 2013-12-20,9371.08,9413.09,9352.98,9400.18,161686900 2013-12-19,9279.68,9351.9,9257.24,9335.74,98276500 2013-12-18,9145.35,9190.73,9122.05,9181.75,82342700 2013-12-17,9142.75,9161.8,9085.12,9085.12,72207500 2013-12-16,9004.62,9187.78,8997.75,9163.56,99105600 2013-12-13,9016.78,9046.63,8990.58,9006.46,67761700 2013-12-12,9032.67,9060.54,8984.28,9017,75120200 2013-12-11,9093.26,9153.14,9065.51,9077.11,64845800 2013-12-10,9180.29,9223.73,9091.97,9114.44,74363400
why code dont't work ? don't work: - 2 panes, candlestick , volume - ohlc - 1.7 million points async loading...
the issue in "date" in csv or else ... ?
Comments
Post a Comment