Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

echarts Y axis label having vertical text

Tags:

jquery

echarts

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

like image 567
Rupesh Arora Avatar asked May 10 '17 05:05

Rupesh Arora


People also ask

How do you label the vertical axis values in Excel?

Click the chart, and then click the Chart Layout tab. Under Labels, click Axis Titles, point to the axis that you want to add titles to, and then click the option that you want. Select the text in the Axis Title box, and then type an axis title.

What is the label for the vertical axis?

Label Axes as "X" and "Y" Label your axes as you would a typical graph, with x on the horizontal axis and y on the vertical axis.

How do I know which axis to label?

To properly label a graph, you should identify which variable the x-axis and y-axis each represent. Don't forget to include units of measure (called scale) so readers can understand each quantity represented by those axes. Finally, add a title to the graph, usually in the form "y-axis variable vs. x-axis variable."


1 Answers

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

like image 173
E. Lion Avatar answered Oct 15 '22 19:10

E. Lion