This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
cyber-narrator-cn-ui/src/components/charts/StatisticsLegend.vue

154 lines
2.9 KiB
Vue
Raw Normal View History

2021-07-05 22:58:12 +08:00
<template>
<div class="chart__legend"></div>
2021-07-08 08:57:29 +08:00
<div class="char__table">
<div class="char__table-top">
<div class="char-table-min blue-top">Average</div>
<div class="char-table-max blue-button">Maximum</div>
</div>
<div class="char__table-bottom">
<div class="box__color" >
2021-07-08 16:23:11 +08:00
<p v-for="i in chartColor" :style="{'background':i}" :key="i" :title="i"></p>
2021-07-08 08:57:29 +08:00
</div>
<div class="box__text">
2021-07-08 16:23:11 +08:00
<p v-for="s in data" :key="s" :title="s.legend">{{s.legend}}</p>
2021-07-08 08:57:29 +08:00
</div>
<div class="char__table-bottom-min">
2021-07-08 16:23:11 +08:00
<p v-for="item in data" :key="item" :title="item.aggregation.avg">{{item.aggregation.avg}}</p>
2021-07-08 08:57:29 +08:00
</div>
<div class="char__table-bottom-max">
2021-07-08 16:23:11 +08:00
<p v-for="items in data" :key="items" :title="items.aggregation.max">{{items.aggregation.max}}</p>
2021-07-08 08:57:29 +08:00
</div>
</div>
</div>
2021-07-05 22:58:12 +08:00
</template>
<script>
2021-07-08 08:57:29 +08:00
import { getChartColor } from '@/components/charts/chart-options'
import {chartColor} from "./chart-options";
2021-07-05 22:58:12 +08:00
export default {
name: 'StatisticsLegend',
props: {
data: Array
},
watch: {
data: {
immediate: true,
deep: true,
handler (n) {
2021-07-08 16:23:11 +08:00
console.log(n)
2021-07-05 22:58:12 +08:00
}
}
2021-07-08 08:57:29 +08:00
},
setup () {
return {
getChartColor,
chartColor }
2021-07-05 22:58:12 +08:00
}
}
2021-07-08 08:57:29 +08:00
2021-07-05 22:58:12 +08:00
</script>
<style scoped>
2021-07-08 08:57:29 +08:00
.char__table{
2021-07-08 16:23:11 +08:00
width: 455px;
height: 111px;
border: 1px solid #E7EAED;
2021-07-08 08:57:29 +08:00
font-size: 10px;
color:#5f6368;
margin: auto;
}
.char__table-top{
position: relative;
2021-07-08 16:23:11 +08:00
width: 455px;
height: 30px;
2021-07-08 08:57:29 +08:00
line-height: 35px;
display: flex;
2021-07-08 16:23:11 +08:00
border-bottom: #E7EAED 1px solid;
2021-07-08 08:57:29 +08:00
}
.blue-button{
position:absolute;
2021-07-08 16:23:11 +08:00
right: 20px;
top: -3px;
font-family: Roboto-Regular;
font-size: 14px;
color: #0091FF;
font-weight: 400;
2021-07-05 22:58:12 +08:00
2021-07-08 08:57:29 +08:00
}
.blue-top{
position:absolute;
2021-07-08 16:23:11 +08:00
right: 125px;
top: -3px;
font-family: Roboto-Regular;
font-size: 14px;
color: #0091FF;
font-weight: 400;
2021-07-08 08:57:29 +08:00
}
.char__table-bottom{
position: relative;
color: #5f6368;
2021-07-08 16:23:11 +08:00
width: 455px;
height: 75px;
2021-07-08 08:57:29 +08:00
display: flex;
justify-content: center;
align-items: center;
text-align: center;
}
.char__table-bottom-max{
position:absolute;
2021-07-08 16:23:11 +08:00
width: 46px;
2021-07-08 08:57:29 +08:00
height: 100%;
2021-07-08 16:23:11 +08:00
right: 122px;
top: -4px;
overflow: scroll;
}
.char__table-bottom-max::-webkit-scrollbar{
display: none;
2021-07-08 08:57:29 +08:00
}
.char__table-bottom-min{
position:absolute;
2021-07-08 16:23:11 +08:00
width: 66px;
2021-07-08 08:57:29 +08:00
height: 100%;
2021-07-08 16:23:11 +08:00
right: 16px;
top: -4px;
overflow: scroll;
2021-07-08 08:57:29 +08:00
}
2021-07-08 16:23:11 +08:00
.char__table-bottom-min::-webkit-scrollbar{
display: none;
2021-07-08 08:57:29 +08:00
}
.box__color{
width: 30px;
height: 79px;
position:absolute;
left: 22px;
top: 2px;
box-sizing: border-box;
2021-07-08 16:23:11 +08:00
margin-top: -4px;
overflow: scroll;
}
.box__color::-webkit-scrollbar{
display: none;
}
.box__color>p{
width: 17px;
height: 7px;
border-radius: 24%;
margin-top: 17px;
2021-07-08 08:57:29 +08:00
}
.box__text{
position:absolute;
left: 58px;
top: 2px;
2021-07-08 16:23:11 +08:00
width: 106px;
2021-07-08 08:57:29 +08:00
height: 100%;
2021-07-08 16:23:11 +08:00
overflow: scroll;
}
.box__text>p{
margin-top: 5px;
width: 115px;
}
.box__text::-webkit-scrollbar{
display: none;
2021-07-08 08:57:29 +08:00
}
</style>