-1

在此处输入图像描述

传递的选项如下:

var chartOptions = {
                        chart: {
                            backgroundColor: 'white',
                            type:'line'
                        },
                        title: { 
                            text:null
                        },
                        xAxis: {
                            gridLineWidth:0.5,
                            gridLineColor:'#e1e1e1',
                            tickInterval:intervalPeriod,
                            tickWidth: 0,
                            type: 'datetime',
                            dateTimeLabelFormats: dateTimeLabelFormats
                        },  
                        yAxis: {
                            gridLineWidth:0.5,
                            gridLineColor:'#e1e1e1',
                            allowDecimals:false,
                            tickAmount: 5,
                            title: {
                                text: null
                            }
                        },
                        tooltip:{
                            shared:true,
                            xDateFormat:'%e  %b, %Y',
                            crosshairs:true
                        }
                }
4

1 回答 1

0

为了显示与系列点同步的刻度,tickInterval您需要具有相同的值。pointInterval当点的间隔不规则时,您可以使用tickPositions数组。

API 参考: http: //api.highcharts.com/highcharts/xAxis.tickInterval
http://api.highcharts.com/highcharts/plotOptions.series.pointInterval
http://api.highcharts.com/highcharts/xAxis.tickPositions

示例: http:
//jsfiddle.net/zycwaexa/ - 使用相同tickIntervalpointInterval http://jsfiddle.net/z7pnwtrs/ - 使用tickPositions

于 2017-09-29T12:13:19.357 回答