簡體   English   中英

HighCharts。 如何將yAxis標題和yAxis標簽對齊在一行中?

[英]HighCharts. How to align yAxis title and yAxis labels to right in one line?

請幫助配置“Highcharts”。 我無法在一行右側對齊標題和標簽。 如果在格式化程序中重新計算了標簽,則會對其進行裁剪。

在此輸入圖像描述

yAxis選項配置:

chart: {
   spacingLeft: 0
},
yAxis: {
   offset: 12,
   title: {
      rotation: 0,
      align: 'high',
      y: -21,
      textAlign: 'right',
      x: 0,
      margin: 0,
      offset: 0,
      text: 'ttl'
   },
   labels: {
      x: 0,
      align: 'right',
      formatter: function(e) {
         return e.value * 333;
      }
   }
}

您可以使用title.xlabels.x屬性來設置空間。 x值包含在圖表大小計算中:

yAxis: {
    title: {
        rotation: 0,
        align: 'high',
        y: -21,
        textAlign: 'right',
        x: -10,
        margin: 0,
        offset: 0,
        text: 'ttl'
    },
    labels: {
        x: -10,
        align: 'right',
        formatter: function(e) {
            return e.value * 333;
        }
    }
}

現場演示: http //jsfiddle.net/BlackLabel/67bv3nts/

API參考:

https://api.highcharts.com/highstock/yAxis.labels.x

https://api.highcharts.com/highstock/yAxis.title.x

暫無
暫無

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

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