Highstock图表无法正确显示系列

时间:2013-09-20 14:13:19

标签: javascript django highcharts django-templates highstock

我使用highstock作为OHLC图表如下,HTML模板用于django web应用程序:

    <!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Bitcoin Example</title>

        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
        <script type="text/javascript" src="http://code.highcharts.com/stock/highstock.js"></script>
        <script type="text/javascript" src="http://code.highcharts.com/stock/modules/exporting.js"></script>
        <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
        <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.1.0/moment.min.js"></script>
        <script type="text/javascript">
$(function() {      
        $.getJSON('https://raw.github.com/kingofhawks/bitcoin/master/bitcoin/static/ohlc.json', function(data) {        
        //$.getJSON('ohlc.json', function(data) {
        //console.log(data);
        var json = JSON.parse(data);
        console.log(json)
        // split the data set into ohlc and volume
        var ohlc = [],
            volume = [],
            dataLength = json.length;

        count = 0;
        error = 0;
        //What's wrong here?
        //for (i = 0; i < dataLength; i++) {//Not worked!
        for (i = 0; i < 131; i++) {//Worked!
            if (_.isUndefined(json[i])){
                error = 1;
                continue;
            }
            count ++;
            console.log(json[i])

            var time = moment(json[i].time, "YYYY-MM-DDTHH:mm:ss")._d.getTime();
            ohlc.push([
                        time,
                        //json[i].time, // the date
                        json[i].open, // open
                        json[i].high, // high
                        json[i].low, // low
                        json[i].close // close
                    ]); 
            volume.push([
                time, // the date
                json[i].amount // the volume
            ])
        }
        console.log(ohlc)
        console.log(count)
        console.log(ohlc.length)
        console.log(error)
        // set the allowed units for data grouping
        var groupingUnits = [[
            'week',                         // unit name
            [1]                             // allowed multiples
        ], [
            'month',
            [1, 2, 3, 4, 6]
        ]];

        // create the chart
        $('#container').highcharts('StockChart', {

            rangeSelector: {
                selected: 1
            },

            title: {
                text: 'AAPL Historical'
            },

            yAxis: [{
                title: {
                    text: 'OHLC'
                },
                height: 200,
                lineWidth: 2
            }, {
                title: {
                    text: 'Volume'
                },
                top: 300,
                height: 100,
                offset: 0,
                lineWidth: 2
            }],

            series: [{
                type: 'candlestick',
                name: 'AAPL',
                data: ohlc,
                dataGrouping: {
                    units: groupingUnits
                }
            }, {
                type: 'column',
                name: 'Volume',
                data: volume,
                yAxis: 1,
                dataGrouping: {
                    units: groupingUnits
                }
            }]
        });
    });
});
        </script>
    </head>
    <body>

<div id="container" style="height: 500px; min-width: 500px"></div>

    </body>
</html>

包含186个对象的JSON数据存储在ohlc.json文件中:

"[{\"time\":\"2011-07-18T06:55:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":2.9},{\"time\":\"2011-07-18T06:56:00\",\"open\":13.14,\"high\":13.14,\"low\":13.14,\"close\":13.14,\"amount\":11.61},{\"time\":\"2011-07-18T06:57:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T06:58:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":2.78},{\"time\":\"2011-07-18T06:59:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:00:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:01:00\",\"open\":13.16,\"high\":13.16,\"low\":13.15,\"close\":13.15,\"amount\":0.42},{\"time\":\"2011-07-18T07:02:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":0.41},{\"time\":\"2011-07-18T07:03:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":6.9},{\"time\":\"2011-07-18T07:04:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":1.5},{\"time\":\"2011-07-18T07:05:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":4.9},{\"time\":\"2011-07-18T07:06:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:07:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:08:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:09:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:10:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:11:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:12:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":13.94},{\"time\":\"2011-07-18T07:13:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":18.0},{\"time\":\"2011-07-18T07:14:00\",\"open\":13.15,\"high\":13.15,\"low\":13.13,\"close\":13.13,\"amount\":9.71},{\"time\":\"2011-07-18T07:15:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:16:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":9.25},{\"time\":\"2011-07-18T07:17:00\",\"open\":13.13,\"high\":13.13,\"low\":13.12,\"close\":13.12,\"amount\":13.03},{\"time\":\"2011-07-18T07:18:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:19:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":0.18},{\"time\":\"2011-07-18T07:20:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":0.74},{\"time\":\"2011-07-18T07:21:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:22:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:23:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:24:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:25:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:26:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":3.63},{\"time\":\"2011-07-18T07:27:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":9.0},{\"time\":\"2011-07-18T07:28:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:29:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:30:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:31:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":1.0},{\"time\":\"2011-07-18T07:32:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":9.0},{\"time\":\"2011-07-18T07:33:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:34:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:35:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":9.58},{\"time\":\"2011-07-18T07:36:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:37:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:38:00\",\"open\":13.12,\"high\":13.15,\"low\":13.12,\"close\":13.15,\"amount\":6.49},{\"time\":\"2011-07-18T07:39:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":14.77},{\"time\":\"2011-07-18T07:40:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":1.0},{\"time\":\"2011-07-18T07:41:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:42:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":7.94},{\"time\":\"2011-07-18T07:43:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":10.0},{\"time\":\"2011-07-18T07:44:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:45:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:46:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":1.0},{\"time\":\"2011-07-18T07:47:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:48:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":13.0},{\"time\":\"2011-07-18T07:49:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":1.97},{\"time\":\"2011-07-18T07:50:00\",\"open\":13.15,\"high\":13.17,\"low\":13.15,\"close\":13.17,\"amount\":6.5},{\"time\":\"2011-07-18T07:51:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":1.94},{\"time\":\"2011-07-18T07:52:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":2.0},{\"time\":\"2011-07-18T07:53:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":0.09},{\"time\":\"2011-07-18T07:54:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:55:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":4.2},{\"time\":\"2011-07-18T07:56:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":13.8},{\"time\":\"2011-07-18T07:57:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T07:58:00\",\"open\":13.17,\"high\":13.17,\"low\":13.16,\"close\":13.16,\"amount\":10.0},{\"time\":\"2011-07-18T07:59:00\",\"open\":13.17,\"high\":13.17,\"low\":13.16,\"close\":13.16,\"amount\":10.58},{\"time\":\"2011-07-18T08:00:00\",\"open\":13.16,\"high\":13.16,\"low\":13.16,\"close\":13.16,\"amount\":2.42},{\"time\":\"2011-07-18T08:01:00\",\"open\":13.15,\"high\":13.15,\"low\":13.1,\"close\":13.1,\"amount\":73.04},{\"time\":\"2011-07-18T08:02:00\",\"open\":13.15,\"high\":13.16,\"low\":13.15,\"close\":13.16,\"amount\":2.13},{\"time\":\"2011-07-18T08:03:00\",\"open\":13.16,\"high\":13.16,\"low\":13.16,\"close\":13.16,\"amount\":15.33},{\"time\":\"2011-07-18T08:04:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":0.5},{\"time\":\"2011-07-18T08:05:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":20.0},{\"time\":\"2011-07-18T08:06:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:07:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":1.0},{\"time\":\"2011-07-18T08:08:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:09:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":10.19},{\"time\":\"2011-07-18T08:10:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:11:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":1.0},{\"time\":\"2011-07-18T08:12:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:13:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:14:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:15:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:16:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:17:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:18:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:19:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:20:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":1.0},{\"time\":\"2011-07-18T08:21:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:22:00\",\"open\":13.13,\"high\":13.15,\"low\":13.13,\"close\":13.15,\"amount\":7.18},{\"time\":\"2011-07-18T08:23:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":1.0},{\"time\":\"2011-07-18T08:24:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":3.0},{\"time\":\"2011-07-18T08:25:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":1.0},{\"time\":\"2011-07-18T08:26:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":1.0},{\"time\":\"2011-07-18T08:27:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:28:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:29:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:30:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:31:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":9.0},{\"time\":\"2011-07-18T08:32:00\",\"open\":13.13,\"high\":13.13,\"low\":13.12,\"close\":13.12,\"amount\":29.15},{\"time\":\"2011-07-18T08:33:00\",\"open\":13.12,\"high\":13.12,\"low\":13.1,\"close\":13.1,\"amount\":16.85},{\"time\":\"2011-07-18T08:34:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:35:00\",\"open\":13.12,\"high\":13.12,\"low\":13.12,\"close\":13.12,\"amount\":9.48},{\"time\":\"2011-07-18T08:36:00\",\"open\":13.12,\"high\":13.12,\"low\":13.12,\"close\":13.12,\"amount\":1.15},{\"time\":\"2011-07-18T08:37:00\",\"open\":13.12,\"high\":13.12,\"low\":13.12,\"close\":13.12,\"amount\":4.0},{\"time\":\"2011-07-18T08:38:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:39:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:40:00\",\"open\":13.12,\"high\":13.12,\"low\":13.12,\"close\":13.12,\"amount\":33.29},{\"time\":\"2011-07-18T08:41:00\",\"open\":13.12,\"high\":13.12,\"low\":13.11,\"close\":13.11,\"amount\":6.71},{\"time\":\"2011-07-18T08:42:00\",\"open\":13.1,\"high\":13.1,\"low\":13.1,\"close\":13.1,\"amount\":9.0},{\"time\":\"2011-07-18T08:43:00\",\"open\":13.1,\"high\":13.1,\"low\":13.1,\"close\":13.1,\"amount\":6.12},{\"time\":\"2011-07-18T08:44:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:45:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:46:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:47:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:48:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:49:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:50:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:51:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:52:00\",\"open\":13.11,\"high\":13.11,\"low\":13.11,\"close\":13.11,\"amount\":1.0},{\"time\":\"2011-07-18T08:53:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:54:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:55:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:56:00\",\"open\":13.14,\"high\":13.15,\"low\":13.14,\"close\":13.15,\"amount\":5.13},{\"time\":\"2011-07-18T08:57:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:58:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T08:59:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:00:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:01:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:02:00\",\"open\":13.14,\"high\":13.14,\"low\":13.14,\"close\":13.14,\"amount\":7.99},{\"time\":\"2011-07-18T09:03:00\",\"open\":13.15,\"high\":13.15,\"low\":13.14,\"close\":13.14,\"amount\":10.01},{\"time\":\"2011-07-18T09:04:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:05:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":10.0},{\"time\":\"2011-07-18T09:06:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":11.0},{\"time\":\"2011-07-18T09:07:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":14.11},{\"time\":\"2011-07-18T09:08:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":9.0},{\"time\":\"2011-07-18T09:09:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":9.0},{\"time\":\"2011-07-18T09:10:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":9.0},{\"time\":\"2011-07-18T09:11:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":9.0},{\"time\":\"2011-07-18T09:12:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":11.1},{\"time\":\"2011-07-18T09:13:00\",\"open\":13.13,\"high\":13.13,\"low\":13.13,\"close\":13.13,\"amount\":1.05},{\"time\":\"2011-07-18T09:14:00\",\"open\":13.14,\"high\":13.15,\"low\":13.14,\"close\":13.15,\"amount\":49.99},{\"time\":\"2011-07-18T09:15:00\",\"open\":13.15,\"high\":13.16,\"low\":13.15,\"close\":13.16,\"amount\":14.01},{\"time\":\"2011-07-18T09:16:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":27.3},{\"time\":\"2011-07-18T09:17:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":0.15},{\"time\":\"2011-07-18T09:18:00\",\"open\":13.17,\"high\":13.17,\"low\":13.16,\"close\":13.16,\"amount\":30.2},{\"time\":\"2011-07-18T09:19:00\",\"open\":13.17,\"high\":13.17,\"low\":13.16,\"close\":13.16,\"amount\":3.6},{\"time\":\"2011-07-18T09:20:00\",\"open\":13.16,\"high\":13.16,\"low\":13.16,\"close\":13.16,\"amount\":15.4},{\"time\":\"2011-07-18T09:21:00\",\"open\":13.15,\"high\":13.17,\"low\":13.15,\"close\":13.17,\"amount\":38.0},{\"time\":\"2011-07-18T09:22:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":9.0},{\"time\":\"2011-07-18T09:23:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":20.0},{\"time\":\"2011-07-18T09:24:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":0.5},{\"time\":\"2011-07-18T09:25:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:26:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:27:00\",\"open\":13.15,\"high\":13.15,\"low\":13.15,\"close\":13.15,\"amount\":1.0},{\"time\":\"2011-07-18T09:28:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:29:00\",\"open\":13.15,\"high\":13.18,\"low\":13.15,\"close\":13.16,\"amount\":19.14},{\"time\":\"2011-07-18T09:30:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:31:00\",\"open\":13.18,\"high\":13.18,\"low\":13.18,\"close\":13.18,\"amount\":2.0},{\"time\":\"2011-07-18T09:32:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:33:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:34:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:35:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:36:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:37:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:38:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":1.73},{\"time\":\"2011-07-18T09:39:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":0.1},{\"time\":\"2011-07-18T09:40:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:41:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:42:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:43:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":1.46},{\"time\":\"2011-07-18T09:44:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:45:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:46:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:47:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:48:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:49:00\",\"open\":13.18,\"high\":13.18,\"low\":13.18,\"close\":13.18,\"amount\":0.02},{\"time\":\"2011-07-18T09:50:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:51:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":9.0},{\"time\":\"2011-07-18T09:52:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":12.8},{\"time\":\"2011-07-18T09:53:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":13.0},{\"time\":\"2011-07-18T09:54:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":1.0},{\"time\":\"2011-07-18T09:55:00\",\"open\":13.18,\"high\":13.19,\"low\":13.18,\"close\":13.19,\"amount\":15.01},{\"time\":\"2011-07-18T09:56:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":4.2},{\"time\":\"2011-07-18T09:57:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":2.0},{\"time\":\"2011-07-18T09:58:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null},{\"time\":\"2011-07-18T09:59:00\",\"open\":13.17,\"high\":13.17,\"low\":13.17,\"close\":13.17,\"amount\":2.0},{\"time\":\"2011-07-18T10:00:00\",\"open\":null,\"high\":null,\"low\":null,\"close\":null,\"amount\":null}]"

问题是高库存图表无法显示任何内容。我无法理解。似乎json文件有问题,但Chrome浏览器没有任何错误。

更新:jsfiddle的代码也不起作用:http://jsfiddle.net/V7mVD/ 我把ohlc.json放到Github,但似乎无法得到它 https://raw.github.com/kingofhawks/bitcoin/master/bitcoin/static/ohlc.json

0 个答案:

没有答案