Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

echarts option nameRotate not working #6386

Closed
LMJS1974 opened this issue Aug 8, 2017 · 4 comments
Closed

echarts option nameRotate not working #6386

LMJS1974 opened this issue Aug 8, 2017 · 4 comments

Comments

@LMJS1974
Copy link

LMJS1974 commented Aug 8, 2017

One-line summary [问题简述]

I am trying to rotate the labels on the xAxis so they are all visible.

Looking at the documentation i see there is an option to use the command nameRotate but it doesn't seem to work..?

tried to apply the syntax to the online demo and not working either....

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.6.2
  • Browser version [浏览器类型和版本]: edge, chrome
  • OS Version [操作系统类型和版本]: windows 10

Expected behaviour [期望结果]

labels in the bottom of chart (xAxis) rotating to vertical

ECharts option [ECharts配置项]

			  var echartBar = echarts.init(document.getElementById('mainb'), theme);

			  echartBar.setOption({
				title: {
				 //text: 'Graph title',
				 //subtext: 'Graph Sub-text'
				},
				tooltip: {
				  trigger: 'axis',
				  formatter: "{a} <br/>{b} : {c}%"

				},
				legend: {
				 // data: ['sales', 'purchases']
				},
				toolbox: {
				  show: false
				},
				calculable: true,
				xAxis: {
				  nameRotate: 90, //Rotation of labels - not working!!!!
				  type: 'category',
				  data: ['Client 1', 'Client2', 'Client3', 'Client4', 'Client5', 'Client6', 'Client7', 'Client8', 'Client9?', 'Client10', 'Client11', 'Client12'] //Clients go here
				},
				yAxis: [{
				  type: 'value'
				}],
				series: [{
				  name: 'Overall Progress',
				  type: 'bar',
				  data: [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
				  markPoint: {
					data: [{
					  type: 'max',
					  name: 'MAxim',
					  					  formatter: "{a} <br/>{b} : {c}%"

					}, {
					  type: 'min',
					  name: '???'
					}]
				  },
				  markLine: {
					data: [{
					  type: 'average',
					  name: 'Average'
					}]
				  }
option = {

}

Other comments [其他信息]

@luguokong
Copy link

xAxis.nameRotate is just used to set the xAxis name's rotate(usually display at the left or right of the axis) . You can set the xAxis.axisLabel.interval or xAxis.axisLabel.rotate to show all the axisLabel.

@LMJS1974
Copy link
Author

LMJS1974 commented Aug 9, 2017

Thank you for clarifying. Clearly I was looking in the wrong place. Working now. Great package! Keep up the good work. :)

@LMJS1974 LMJS1974 closed this as completed Aug 9, 2017
@elipongr
Copy link

Does someone know how to get another not rotated line under the rotated line like this
grafik

@alexlana
Copy link

alexlana commented Dec 9, 2020

@elipongr, define the "rotate" option inside axisLabel:

    graph_options = {
        youroptions: youroptions...,
        xAxis: [{
            youraxisoptions: youraxisoptions...,
            axisLabel: {
              rotate: 45, // <<<<<<<<<<<<<< this option!
            }
        }],
    };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants