0

演示页面上的示例显示了 2 个图表 ( http://www.highcharts.com/stock/demo/candlestick-and-volume ) 上的价格和交易量。

是否可以仅在一张图表中呈现它们?

谢谢。

更新:

好的,在这里得到它: http: //jsfiddle.net/eAFJ3/3/

$('#container').highcharts('StockChart', {

        rangeSelector: {
            enabled: false
        },

        scrollbar: {
            enabled: false
        },

        navigator: {
            enabled: false
        },

        title: {
            text: 'AAPL Historical'
        },

        yAxis: [{
            title: {
                text: 'OHLC'
            },
            lineWidth: 2
        },
        {
            title: {
                text: 'Volume',
                style: {
                    color: "#DDD"
                }
            },
            gridLineWidth: 0,
            opposite: true
        }],

        tooltip: {
            shared: true
        },

        series: [{
            type: 'column',
            name: 'Volume',
            data: volume,
            yAxis: 1,
            color: '#DDD',
            dataGrouping: {
                units: groupingUnits
            }
        }, {
            type: 'candlestick',
            name: 'AAPL',
            data: ohlc,
            yAxis: 0,
            dataGrouping: {
                units: groupingUnits
            }
        }]
    });

了解如何配置图表需要一些时间...您必须定义两个 Y 轴并将 Volume xAxis 作为系列数组中的第一个。否则,它会呈现在蜡烛之上。

4

0 回答 0