码迷,mamicode.com
首页 > 其他好文 > 详细

highcharts中把X轴的名字竖着显示

时间:2018-10-30 10:20:39      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:rds   really   cti   legend   his   nbsp   func   auto   ati   

Highcharts.chart(‘container‘, {
	chart: {
		type: ‘column‘
	},
	title: {
		text: ‘Auto rotation limit‘
	},
	subtitle: {
		text: ‘Short words means word-wrap makes sense‘
	},
	xAxis: {
		type: ‘category‘,
		labels: {
			formatter: function() {
				var labelVal = this.value;
				var reallyVal = ‘‘;
				var lvl = labelVal.length;
				if(lvl > 1){
					for(var i=1;i<=lvl;i++){
						reallyVal += labelVal.substr(i-1,1)+"<br/>";
					}
				}
				return reallyVal.substring(0,reallyVal.length-5);
			}
		}
	},
	series: [{
		showInLegend: false,
		data: [{
			name: ‘观音堂‘,
			y: 77
		}, {
			name: ‘石龙岩‘,
			y: 50
		}, {
			name: ‘王爷庙‘,
			y: 20
		}, {
			name: ‘佛子咀‘,
			y: 48
		}, {
			name: ‘老鹰岩‘,
			y: 36
		}, {
			name: ‘合江‘,
			y: 15
		}, {
			name: ‘哈哈哈‘,
			y: 57
		}]
	}]
});

  技术分享图片

 

highcharts中把X轴的名字竖着显示

标签:rds   really   cti   legend   his   nbsp   func   auto   ati   

原文地址:https://www.cnblogs.com/sily-boy/p/9875010.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!