diff --git a/src/views/health/marStatistic/index.vue b/src/views/health/marStatistic/index.vue new file mode 100644 index 0000000..d609467 --- /dev/null +++ b/src/views/health/marStatistic/index.vue @@ -0,0 +1,680 @@ + + + diff --git a/src/views/health/temperatureStatistic/index.vue b/src/views/health/temperatureStatistic/index.vue index effb475..8ce3a7b 100644 --- a/src/views/health/temperatureStatistic/index.vue +++ b/src/views/health/temperatureStatistic/index.vue @@ -104,7 +104,7 @@ -
+
@@ -145,7 +145,7 @@
高烧次数
- {{ temp.higherTempCount }} (大于38.5℃) + {{ temp.higherTempCount }} 次(大于38.5℃)
@@ -447,7 +447,7 @@ const drawBar = (data) => { { type: 'value', min: 35.5, // 设置 y 轴的最小值为 0 - max: 40.5, // 设置 y 轴的最大值为 100 + // max: 40.5, // 设置 y 轴的最大值为 100 interval: 0.5, //设置y轴刻度间隔 axisTick: { show: true // 默认为true,如果要隐藏,则改为 false @@ -467,16 +467,30 @@ const drawBar = (data) => { type: 'bar', barWidth: 10, // 根据需求调整数值大小,单位是像素 itemStyle: { - color: '#2283cf' + // 此处可以是一个固定颜色值,也可以是一个回调函数根据数据动态计算颜色 + color: function (params) { + // 这里可以根据需要设置不同的颜色,比如根据数据值 + if (params.data < 37) { + return '#37b328' + } else if (params.data >= 37 && params.data < 37.5) { + return '#ff00ff' + } else if (params.data >= 37.5 && params.data < 38.5) { + return '#ff0066' + } else if (params.data >= 38.5 && params.data < 39.5) { + return '#ff0000' + } else if (params.data >= 39.5) { + return '#990000' // 数据在50到99之间为蓝色 + } + } } } ], // 添加点击事件的处理函数 emphasis: { - itemStyle: { - color: '#2283cf', - barWidth: 20 // 根据需求调整数值大小,单位是像素 - }, + // itemStyle: { + // color: '#2283cf', + // barWidth: 20 // 根据需求调整数值大小,单位是像素 + // }, barWidth: 24 // 根据需求调整数值大小,单位是像素 } } @@ -523,7 +537,7 @@ const drawLine = (data) => { yAxis: { type: 'value', min: 35.5, // 设置 y 轴的最小值为 0 - max: 40.5, // 设置 y 轴的最大值为 100 + // max: 40.5, // 设置 y 轴的最大值为 100 interval: 0.5, //设置y轴刻度间隔 axisTick: { show: true @@ -544,7 +558,21 @@ const drawLine = (data) => { color: '#4181c9' }, itemStyle: { - color: '#4181c9' + // 此处可以是一个固定颜色值,也可以是一个回调函数根据数据动态计算颜色 + color: function (params) { + // 这里可以根据需要设置不同的颜色,比如根据数据值 + if (params.data < 37) { + return '#37b328' + } else if (params.data >= 37 && params.data < 37.5) { + return '#ff00ff' + } else if (params.data >= 37.5 && params.data < 38.5) { + return '#ff0066' + } else if (params.data >= 38.5 && params.data < 39.5) { + return '#ff0000' + } else if (params.data >= 39.5) { + return '#990000' // 数据在50到99之间为蓝色 + } + } }, smooth: true, symbol: 'emptyCircle',