|
@@ -57,10 +57,10 @@ import {
|
|
tclData.push(response.data[i].appointFee)
|
|
tclData.push(response.data[i].appointFee)
|
|
tbData.push(response.data[i].testSample)
|
|
tbData.push(response.data[i].testSample)
|
|
}
|
|
}
|
|
- this.eChartsMethod(Data,xzData,tclData,tbData);
|
|
|
|
|
|
+ this.eChartsMethod(Data,xzData,tclData,tbData,response.data);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- eChartsMethod(Data,xzData,tclData,tbData) {
|
|
|
|
|
|
+ eChartsMethod(Data,xzData,tclData,tbData,response) {
|
|
let option = {
|
|
let option = {
|
|
//你的代码
|
|
//你的代码
|
|
tooltip: {//提示框组件
|
|
tooltip: {//提示框组件
|
|
@@ -69,6 +69,35 @@ import {
|
|
textStyle: {
|
|
textStyle: {
|
|
fontSize: 18
|
|
fontSize: 18
|
|
},
|
|
},
|
|
|
|
+ formatter: function (params) {
|
|
|
|
+ let result = params[0].name;
|
|
|
|
+ params.forEach(function (item) {
|
|
|
|
+ let colorData = item.seriesName == '使用机时'?'#35C1C2':(item.seriesName == '预约费用'?'#DF7805':(item.seriesName == '测试样品'?'#CE3A2A':''))
|
|
|
|
+ result += "<br/>";
|
|
|
|
+ // item 是每一个系列的数据
|
|
|
|
+ const seriesName = item.seriesName; // 系列名称
|
|
|
|
+ let value = '';
|
|
|
|
+ if(item.seriesName == '使用机时'){
|
|
|
|
+ for(let i=0;i<response.length;i++){
|
|
|
|
+ if(item.value == response[i].useTime){
|
|
|
|
+ value = response[i].useTimeStr;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ value = item.value;
|
|
|
|
+ }
|
|
|
|
+ // const value = item.value; // 数据值
|
|
|
|
+ let a = '<span style="border-radius:50%;background:'
|
|
|
|
+ let b = ';display:inline-block;width:10px;height:10px;">'
|
|
|
|
+ let c = '</span><span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;" ></span>'
|
|
|
|
+ result += a+colorData+b+c;
|
|
|
|
+ // result += '<span style="border-radius:50%;background:+colorData+;display:inline-block;width:10px;height:10px;"></span><span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;" ></span>';
|
|
|
|
+ // result += `${seriesName}: ${value}<br/>`;
|
|
|
|
+ result += `${seriesName}: ${value}`;
|
|
|
|
+ });
|
|
|
|
+ return result;
|
|
|
|
+ // return `${params.name}:${chartData[params.dataIndex]}`;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
itemWidth: 20,
|
|
itemWidth: 20,
|
|
@@ -79,7 +108,7 @@ import {
|
|
textStyle: {
|
|
textStyle: {
|
|
fontSize: 18,
|
|
fontSize: 18,
|
|
color: '#fff',
|
|
color: '#fff',
|
|
- }
|
|
|
|
|
|
+ },
|
|
},
|
|
},
|
|
grid: {
|
|
grid: {
|
|
top: '20%',
|
|
top: '20%',
|
|
@@ -161,7 +190,7 @@ import {
|
|
],
|
|
],
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
- name: '使用时间',
|
|
|
|
|
|
+ name: '使用机时',
|
|
type: 'bar',
|
|
type: 'bar',
|
|
barWidth: 14,
|
|
barWidth: 14,
|
|
data: xzData,
|
|
data: xzData,
|