|
@@ -83,18 +83,16 @@ const initChart = () => {
|
|
const result: string[] = [];
|
|
const result: string[] = [];
|
|
|
|
|
|
for (const obj of objs[0].value) {
|
|
for (const obj of objs[0].value) {
|
|
- if (!uniqueTypes.has(obj.type)) {
|
|
|
|
- uniqueTypes.add(obj.type);
|
|
|
|
|
|
+ if (!uniqueTypes.has(obj.label)) {
|
|
|
|
+ uniqueTypes.add(obj.label);
|
|
result.push(obj.label);
|
|
result.push(obj.label);
|
|
}
|
|
}
|
|
- if (uniqueTypes.size === 3) {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
const nameArr = getFirstThreeUniqueTypes(objs);
|
|
const nameArr = getFirstThreeUniqueTypes(objs);
|
|
|
|
+ console.log('getFirstThreeUniqueTypes nameArr', nameArr)
|
|
// 动态生成多个 <div> 元素
|
|
// 动态生成多个 <div> 元素
|
|
const colors = ["#FC3F3F", "#FF8C00", "#0982FE"];
|
|
const colors = ["#FC3F3F", "#FF8C00", "#0982FE"];
|
|
const nameDivs = nameArr
|
|
const nameDivs = nameArr
|
|
@@ -107,7 +105,7 @@ const initChart = () => {
|
|
)
|
|
)
|
|
.join("");
|
|
.join("");
|
|
return `
|
|
return `
|
|
- <div style="max-height: 150px; width: 200px;background:'#fff';borderRadius:'6px'">
|
|
|
|
|
|
+ <div style="min-height: 50px; width: 200px;background:'#fff';borderRadius:'6px'">
|
|
<div style="border-bottom:1px solid #eee;line-height:30px;text-align:center">${date}</div>
|
|
<div style="border-bottom:1px solid #eee;line-height:30px;text-align:center">${date}</div>
|
|
${nameDivs}
|
|
${nameDivs}
|
|
<div style="border-bottom:1px solid #eee;line-height:30px;text-align:center;color:#0982FE;cursor: pointer;"
|
|
<div style="border-bottom:1px solid #eee;line-height:30px;text-align:center;color:#0982FE;cursor: pointer;"
|