var myChart = echarts.init(document.getElementById('my_chart'));
option = {
title: {
text: '使用率'
},
tooltip: { //悬浮提示自定义格式化显示
trigger: 'axis',
formatter: function (params) {
var result = '';
params.forEach(function (item) {
result += item.name + "<br>" + item.marker + " " + item.seriesName + " : " + item.value + "%" + "</br>";
});
return result;
}
},
legend: {
data: ['利用率']
},
calculable: true,
xAxis: [{
type: 'category',
boundaryGap: false,
data: data_legend
}],
yAxis: [{
type: 'value',
axisLabel: {
formatter: '{value}%'
}
}],
series: [{
name: '利用率',
type: 'line',
data: data_series
}]
};
myChart.setOption(option);
echart自定义显示设置
最新推荐文章于 2024-05-10 14:21:12 发布