为不同的载造比视图添加颜色

master
yezhichao 2021-12-01 10:54:33 +08:00
parent ae279fb238
commit 7045f10960
2 changed files with 9 additions and 10 deletions

View File

@ -22,7 +22,8 @@ use([
]);
const props = defineProps({
title: String
title: String,
color: String
})
const BAR_COUNT = 30
@ -60,16 +61,14 @@ const option = reactive({
}
},
itemStyle: {
color: ({ value }) => {
return value[2] ? IN_POSITIONING_COLOR : UN_POSITIONING_COLOR
}
}
color: props.color
},
}]
})
const update = (GSVArr: Array<any>, GSAArr: Array<any>) => {
const SNROption: any = getSNROption(GSVArr, GSAArr)
if (!SNROption) return
if (SNROption.xAxis.data.length !== SNROption.series[0].data.length) {
return
}

View File

@ -4,16 +4,16 @@
<div class="main-content flex-1 grid grid-cols-2 grid-rows-2">
<div>
<SNRView ref="BDSNRView" title="北斗" />
<SNRView ref="BDSNRView" color="rgb(0,204,255)" title="北斗" />
</div>
<div>
<SNRView ref="GPSNRView" title="GPS" />
<SNRView ref="GPSNRView" color="rgb(255,255,0)" title="GPS" />
</div>
<div>
<SNRView ref="GLSNRView" title="格洛纳斯" />
<SNRView ref="GLSNRView" color="rgb(102,0,255)" title="格洛纳斯" />
</div>
<div>
<SNRView ref="GASNRView" title="伽利略" />
<SNRView ref="GASNRView" color="rgb(0,204,102)" title="伽利略" />
</div>
</div>
</full-screen-container>