簡體   English   中英

Highcharts 標記對齊與軸網格線不匹配

[英]Highcharts marker alignment not matched with Axis gridlines

在此處輸入圖片說明

選項傳遞如下:

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
                        }
                }

您需要為tickIntervalpointInterval設置相同的值,以便顯示與系列點同步的刻度。 當點的間隔不規則時,您可以使用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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM