1、去掉坐标轴刻度线,刻度数据,坐标轴网格,以Y轴为例,同理X轴
xAxis: [{
type: 'category',
axisTick: {//决定是否显示坐标刻度
alignWithLabel: true,
show:false
},
axisLabel:{ //决定是否显示数据
show:false
}
}],
yAxis: [{
type: 'value',
axisTick: {
show: false
},
splitLine:{ //决定是否显示坐标中网格
show:true
}
}],
2、xAxis.axisLabel.formatter string, Function
[ default: null ]
刻度标签的内容格式器,支持字符串模板和回调函数两种形式。
// 使用字符串模板,模板变量为刻度默认标签 {value}
formatter: '{value} kg'
// 使用函数模板,函数参数分别为刻度数值(类目),刻度的索引
formatter: function (value, index) {
// 格式化成月/日,只在第一个刻度显示年份
var date = new Date(value);
var texts = [(date.getMonth() + 1), date.getDate()];
if (index === 0) {
texts.unshift(date.getYear());
}
return texts.join('/');
}
axisLabel:{
show:true,
formatter: function (value, index) {//value当前值,index当前索引
return value.split(' ')[1];
}
}