|
@@ -83,18 +83,16 @@ const initChart = () => {
|
|
|
const result: string[] = [];
|
|
|
|
|
|
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);
|
|
|
}
|
|
|
- if (uniqueTypes.size === 3) {
|
|
|
- break;
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
const nameArr = getFirstThreeUniqueTypes(objs);
|
|
|
+ console.log('getFirstThreeUniqueTypes nameArr', nameArr)
|
|
|
// 动态生成多个 <div> 元素
|
|
|
const colors = ["#FC3F3F", "#FF8C00", "#0982FE"];
|
|
|
const nameDivs = nameArr
|
|
@@ -107,7 +105,7 @@ const initChart = () => {
|
|
|
)
|
|
|
.join("");
|
|
|
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>
|
|
|
${nameDivs}
|
|
|
<div style="border-bottom:1px solid #eee;line-height:30px;text-align:center;color:#0982FE;cursor: pointer;"
|