0

我已经尝试了所有可能性,但无法将图表拿出来。你能帮我理解吗?我已经验证了这些值是正确的。

日期:1259193600000 开盘:2.3 高:2.39 低:2.27 收盘:2.3 成交量:70708000

    // split the data set into ohlc and volume
    var ohlc = [], volume = [], dataLength = data1.length;

            for (var i = 0; i < dataLength; i++) {

                    ohlc.push([
            data1[i]['date'], // the date
            data1[i]['open'], // open
            data1[i]['highest'], // high
            data1[i]['lowest'], // low
            data1[i]['close'] // close
        ]);

        volume.push([
            data1[i]['date'], // the date
            data1[i]['volume'] // the volume
        ]);
    }

    // set the allowed units for data grouping
    var groupingUnits = [[
        'week',                         // unit name
        [1]                             // allowed multiples
    ], [
        'month',
        [1, 2, 3, 4, 6]
    ]];

    // create the chart
    $('#chart').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
            }
        }]
    });
4

0 回答 0