echarts Y axis label having vertical text

Rupesh Arora picture Rupesh Arora · May 10, 2017 · Viewed 11.6k times · Source

All I'm trying to make charts using e charts library read the documentation and find lots of example over internet too but unable to find how to write label in y-axis with vertical text.

As per the docs where it might be write is axisLabel : {} object but still not sure.

Just want a simple text in vertical at y-axis

Answer

E. Lion picture E. Lion · May 10, 2017

To insert the label on the y axis in vertical position, you should included the following suboptions in the yAxis option:

Code example:

    .......
    yAxis : [
      {
        type : 'value',
        axisLabel : {
          formatter: '{value} °C'
        },
        name: 'Y-Axis',
        nameLocation: 'middle',
        nameGap: 50
      }
    ],
    .......

where the nameLocation: 'middle' option will position the label vertically; And the nameGap: 50 option, indicates the separation with the axisLabel tags.

Attached a screenshot with the result

I hope you help and sorry for my English