Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to truncate the axis name in echarts

I try to have a truncated axis name for yAxis in echarts without success. Even setting the overflow option to truncated, which should render ellipsis a the end has no effect, same for setting a short width. The setting looks like this:

nameTextStyle:{
  overflow : 'truncate',
  align:'left',
  ellipsis :'...',
}

example can be found here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

nameTruncate would work:

yAxis: {
  type: "value",
  name: "very very very very very very long axis name",

  nameTruncate: {
    maxWidth: 100,
    ellipsis: "..."
  }
},

which results into:

enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading