高图的语法错误

时间:2013-10-29 14:51:20

标签: javascript highcharts highstock

我已经尝试了所有可能性,但无法获得图表。你能帮我理解吗?我已经证实价值是正确的。

日期: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
            }
        }]
    });

0 个答案:

没有答案