简体   繁体   English

海图范围选择器(缩放)图表容器之后的按钮位置

[英]Highcharts.stockChart Range Selector (zoom) Button Position After the Chart Container

I want to place the range selector button after the chart display area. 我想将范围选择器按钮放在图表显示区域之后。 Any one suggest me how to implement that. 任何人都建议我如何实现这一目标。

Current Output 电流输出

Expected Output 预期产量

Code Used 使用的代码

Highcharts.stockChart('chartcontainer', {
    rangeSelector: {
        selected: 1
    },

    title: {
        text: 'AAPL Stock Price'
    },

    plotOptions: {
        candlestick: {
            color: '#00c800',
            upColor: '#c80000'
        }
    },

    series: [{
        type: 'candlestick',
        name: 'AAPL Stock Price',
        data: data,
        dataGrouping: {
            units: [
                [
                    'week', // unit name
                    [1] // allowed multiples
                ], [
                    'month',
                    [1, 2, 3, 4, 6]
                ]
            ]
        }
    }]
});

At least one way to do it is to juggle several margins and x/y-positions. 至少一种方法是处理多个边距和x / y位置。 The problem is that the positioning for both the navigator and the range selector do not offer very dynamic positioning options. 问题是导航器和范围选择器的定位都没有提供非常动态的定位选项。

See this example ( JSFiddle demonstration based on this demo ): 请参见以下示例(基于此演示的 JSFiddle 演示 ):

chart: {
    marginTop: 20, // Close the gap where the range selector used to be
    marginBottom: 60, // Make space for the new range selector position
},

rangeSelector: {
    selected: 1,
    buttonPosition: {
        x: 0,
        y: 370 // Move the range selector down the Y-axis
    }
},

navigator: {
    top: 300 // Reposition the navigator based on the top of the chart
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM