Browse Source

fix: 气压保留两位小数

master
guoapeng 2 weeks ago
parent
commit
a3318c3e12
  1. 14
      src/components/seal/DashboardChart.vue

14
src/components/seal/DashboardChart.vue

@ -17,9 +17,11 @@ watchEffect(() => {
} }
if (myChart) { if (myChart) {
myChart.setOption({ myChart.setOption({
series: [{
data: [{ value: pressure }],
}],
series: [
{
data: [{ value: Number(pressure || 0).toFixed(2) }],
},
],
}) })
} }
}) })
@ -53,7 +55,7 @@ const initChart = () => {
}, },
data: [ data: [
{ {
value: realTimePressure.value,
value: Number(realTimePressure.value || 0).toFixed(2),
}, },
], ],
}, },
@ -75,8 +77,8 @@ onUnmounted(() => {
</template> </template>
<style> <style>
canvas{
canvas {
width: 60vw !important; width: 60vw !important;
height: 70vh !important; height: 70vh !important;
}
}
</style> </style>
Loading…
Cancel
Save