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]; } }
3、echarts 圖例顯示到右邊
legend: { data:['同齡普通孩子','已具備技能','已泛化技能','已掌握技能','學習中'], orient: 'vertical', //垂直顯示
y: 'center', //延Y軸居中
x: 'right' //居右顯示
},
4、折線圖平滑曲線
series : [ { symbol:'none', //去掉折線圖中的節點
smooth: false //true 為平滑曲線,false為直線
} ]