| | |
| | | symbolSize: 6, |
| | | lineStyle: { |
| | | width: 2, |
| | | color: "#70CAAE", |
| | | color: '#70CAAE', |
| | | }, |
| | | itemStyle: { |
| | | color: "#70CAAE", |
| | | color: (params: any) => getColor(params.value), |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | }; |
| | | |
| | | chart.setOption(option, true); // 第二个参数为 true 表示全量更新 |
| | | }; |
| | | |
| | | const getColor = (val: number) => { |
| | | if (val < 1.2) return "#FE0201"; // 红色 |
| | | if (val <= 1.6) return "#70CAAE"; // 绿色 |
| | | return "#FE6500"; // 橙色 |
| | | }; |
| | | |
| | | /** 生成血压脉搏趋势图 */ |
| | |
| | | |
| | | const option = { |
| | | grid: [ |
| | | { top: "5%", height: "28%", left: 40, right: 20, containLabel: true }, |
| | | { top: "35%", height: "28%", left: 40, right: 20, containLabel: true }, |
| | | { top: "65%", height: "28%", left: 40, right: 20, containLabel: true }, |
| | | { top: "5%", height: "28%", left: 40, right: 20, containLabel: true }, |
| | | { top: "35%", height: "28%", left: 40, right: 20, containLabel: true }, |
| | | { top: "65%", height: "28%", left: 40, right: 20, containLabel: true }, |
| | | ], |
| | | tooltip: { |
| | | trigger: "axis", |