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
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.
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.
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."
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With