稳态综合评估

This commit is contained in:
仲么了
2024-02-28 15:26:31 +08:00
parent 279db34690
commit 9e288b49be
6 changed files with 211 additions and 164 deletions

View File

@@ -1,14 +1,14 @@
<template>
<div ref='chartRef' class='my-chart' />
<div ref="chartRef" class="my-chart" />
</template>
<script setup lang='ts'>
<script setup lang="ts">
import { onBeforeUnmount, onMounted, ref, defineExpose, watch } from 'vue'
// import echarts from './echarts'
import * as echarts from 'echarts' // 全引入
import 'echarts-gl'
import 'echarts/lib/component/dataZoom'
import { color, gradeColor } from './color'
import { color, gradeColor3 } from './color'
const chartRef = ref<HTMLDivElement>()
@@ -112,7 +112,9 @@ const handlerBar = (options: any) => {
if (params.value == 0 || params.value == 3.14159) {
return '#ccc'
} else {
return color[params.seriesIndex]
return props.options.color
? props.options.color[params.seriesIndex]
: color[params.seriesIndex]
}
}
},
@@ -212,7 +214,7 @@ watch(
)
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.my-chart {
height: 100%;
width: 100%;

View File

@@ -10,4 +10,5 @@ export const color = [
'#66FFCC',
'#B3B3B3'
]
export const gradeColor = ['#339966', '#FFCC33', '#CC0000']
export const gradeColor3 = ['#339966', '#FFCC33', '#CC0000']
export const gradeColor5 = ['#00CC00', '#99CC99', '#FF9900','#996600','#CC0000']