首页 > 解决方案 > highstock xaxis.ordnial = true 不工作

问题描述

我想消除烛台 highstock 图表中创建的缺口。我尝试设置 ordinal = true,但没有任何变化。我的图表在平日/周末产生了很多空白。这是 HighStock 图表的错误吗?

   var chart = Highcharts.stockChart({
            chart: {
                renderTo: 'container',   
                events: {
                    load: function () {

                        //---get new tick                                                                                                                                                                   
                    }
                }          
            },
            navigator: {
                margin: 2
            },                   
            rangeSelector: {
                allButtonsEnabled: true,
                selected: 2
            },

            title: {
                text: 'STOCHASTIC'
            },  
            xAxis: {
                ordinal: true
            },              

            series: [{
                type: 'candlestick',
                name: 'STOCHASTIC',
                data: content,
                dataGrouping: {
                    units: [
                        [
                            'week', // unit name
                            [1] // allowed multiples
                        ], [
                            'month',
                            [1, 2, 3, 4, 6]
                        ]
                    ]
                }
            }]
        });  
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<div id="container" style="height: 400px; min-width: 600px"></div>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>

标签: javascripthighcharts

解决方案


推荐阅读