HighCharts适合长Y轴标签

时间:2019-07-28 15:23:41

标签: highcharts

我有一些大的垂直(Y)轴标签名称。显示它们时,它们会缩小实际图表的大小,并且读取它们会造成混乱。 这是图片:

enter image description here

从图像中可以看出,标签未对齐。如何使它们正确对齐?

以下是我正在使用的图表选项:

{
  "plotOptions": {
    "series": {
      "pointPadding": 0,
      "borderWidth": 0
    }
  },
  "chart": {
    "height": "50%"
  },
  "rangeSelector": {
    "selected": 1
  },
  "title": {
    "text": "Index EOD Analysis"
  },
  "tooltip": {
    "split": true
  },
  "yAxis": [
    {
      "labels": {
        "align": "right",
        "x": -3
      },
      "title": {
        "text": "OHLC"
      },
      "height": "60%"
    },
    {
      "labels": {
        "align": "right",
        "x": -3
      },
      "height": "20%",
      "top": "60%",
      "title": {
        "text": "FII Consolidated PCR"
      }
    },
    {
      "labels": {
        "align": "right",
        "x": -3
      },
      "height": "20%",
      "top": "80%",
      "title": {
        "text": "Net Seller Index"
      }
    }
  ],
  "series": [
    {...}
  ]

1 个答案:

答案 0 :(得分:1)

您可以增加标签的宽度:

posts

实时演示: http://jsfiddle.net/BlackLabel/eb4g6rtc/

API参考: https://api.highcharts.com/highcharts/yAxis.title.style