2015-09-30 47 views
0

據我所知,Highcharts中的固體測量儀圖表類型沒有提供任何方法來自動確保y軸標籤(本例中爲150500500)與實際圖表圖形重疊。鑑於不可預測的數據,基本上我沒有辦法阻止這種重疊的可能性,也沒有將標籤的y偏移量定位得離圖表很遠。有什麼建議麼?固體測量儀:防止重疊儀表的y軸標籤

enter image description here

實施例:http://codepen.io/cmalven/pen/58a2b0bc047c05c8c35cdaa4bb733e61/

圖表OPTS:

$(function() { 

    $('#container-speed').highcharts(Highcharts.merge({}, 
    { 
    "colors": [ 
    "#4FB04F" 
    ], 
    "yAxis": { 
     "min": 0, 
     "max": 200500500, 
     "tickPositions": [ 
     0, 
     150500500, 
     200500500 
     ], 
     "labels": { 
     "y": 24, 
     "style": { 
      "color": "#0e4d5c" 
     } 
     }, 
     "lineWidth": 0, 
     "minorTickInterval": null, 
     "tickWidth": 0, 
     "title": { 
     "enabled": false 
     } 
    }, 
    "series": [ 
    { 
     "name": "Speed", 
     "data": [ 
     150500500 
     ] 
    } 
    ], 
    "chart": { 
     "type": "solidgauge", 
     "height": 190 
    }, 
    "title": { 
     "text": "" 
    }, 
    "pane": { 
     "center": [ 
     "50%", 
     "125%" 
     ], 
     "size": "240%", 
     "startAngle": -70, 
     "endAngle": 70, 
     "background": { 
     "backgroundColor": "#0e4d5c", 
     "borderWidth": 0, 
     "innerRadius": "81%", 
     "outerRadius": "92%", 
     "shape": "arc" 
     } 
    }, 
    "tooltip": { 
     "enabled": false 
    }, 
    "plotOptions": { 
     "solidgauge": { 
     "innerRadius": "88%", 
     "radius": "85%", 
     "dataLabels": { 
      "enabled": false 
     } 
     } 
    }, 
    "credits": { 
     "enabled": false 
    } 
    })); 

    }); 

回答