123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template>
- <div class="left-charts">
- <div class="left-chart-item">
- <dv-charts class="item-chart" :option="option" />
- <div class="item-chart-word zongshu">用户总数</div>
- </div>
- <div class="left-chart-item">
- <dv-charts class="item-chart" :option="option1" />
- <div class="item-chart-word zaixianshu">绑定设备</div>
- </div>
- <div class="left-chart-item">
- <dv-charts class="item-chart" :option="option2" />
- <div class="item-chart-word lixianshu">绑定用户数</div>
- </div>
- <div class="left-chart-item">
- <dv-charts class="item-chart" :option="option3" />
- <div class="item-chart-word gaojingshu">设备活跃度</div>
- </div>
- </div>
- </template>
- <script>
- import LabelTag from "./LabelTag";
- import { count, alarm } from "@/api/system/datav";
- export default {
- name: "BottomCharts",
- props: {
- number: {
- type: Number,
- default: 0,
- },
- data:{
- type:Object,
- default:{},
- }
- },
- components: {
- LabelTag,
- },
- data() {
- return {
- // userTotal:0,
- option: {
- series: [
- {
- type: "gauge",
- startAngle: -Math.PI / 2,
- endAngle: Math.PI * 1.5,
- arcLineWidth: 10,
- data: [
- {
- name: "itemA",
- value: this.number,
- // gradient: ["#03c2fd", "#1ed3e5", "#2fded6"],
- gradient: ["#01dcdf"],
- },
- ],
- axisLabel: {
- show: false,
- },
- axisTick: {
- show: false,
- },
- pointer: {
- show: false,
- },
- dataItemStyle: {
- lineCap: "round",
- },
- details: {
- show: true,
- formatter: "{value}",
- style: {
- fill: "#1ed3e5",
- fontSize: 20,
- },
- },
- },
- ],
- },
- option1: {
- series: [
- {
- type: "gauge",
- startAngle: -Math.PI / 2,
- endAngle: Math.PI * 1.5,
- arcLineWidth: 10,
- data: [
- {
- name: "itemA",
- value: this.data.bindDevice,
- // gradient: ["#03c2fd", "#1ed3e5", "#2fded6"],
- gradient: ["#33faaa"],
- },
- ],
- axisLabel: {
- show: false,
- },
- axisTick: {
- show: false,
- },
- pointer: {
- show: false,
- },
- dataItemStyle: {
- lineCap: "round",
- },
- details: {
- show: true,
- formatter: "{value}",
- style: {
- fill: "#1ed3e5",
- fontSize: 20,
- },
- },
- },
- ],
- },
- option2: {
- series: [
- {
- type: "gauge",
- startAngle: -Math.PI / 2,
- endAngle: Math.PI * 1.5,
- arcLineWidth: 10,
- data: [
- {
- name: "itemA",
- value: this.data.bindUser,
- // gradient: ["#03c2fd", "#1ed3e5", "#2fded6"],
- gradient: ["#f7ac20"],
- },
- ],
- axisLabel: {
- show: false,
- },
- axisTick: {
- show: false,
- },
- pointer: {
- show: false,
- },
- dataItemStyle: {
- lineCap: "round",
- },
- details: {
- show: true,
- formatter: "{value}",
- style: {
- fill: "#1ed3e5",
- fontSize: 20,
- },
- },
- },
- ],
- },
- option3: {
- series: [
- {
- type: "gauge",
- startAngle: -Math.PI / 2,
- endAngle: Math.PI * 1.5,
- arcLineWidth: 10,
- data: [
- {
- name: "itemA",
- value: this.data.deviceOnline,
- // gradient: ["#03c2fd", "#1ed3e5", "#2fded6"],
- gradient: ["#f93496", "#f61967","#f2053e"],
- },
- ],
- axisLabel: {
- show: false,
- },
- axisTick: {
- show: false,
- },
- pointer: {
- show: false,
- },
- dataItemStyle: {
- lineCap: "round",
- },
- details: {
- show: true,
- formatter: "{value}",
- style: {
- fill: "#1ed3e5",
- fontSize: 20,
- },
- },
- animationFrame: 10,
- },
- ],
- },
- };
- },
- };
- </script>
- <style lang="scss">
- .left-charts {
- width: 100%;
- height: 80%;
- display: flex;
- position: relative;
- .left-chart-item {
- width: 25%;
- height: 100%;
- box-sizing: border-box;
- text-align: center;
- .item-chart {
- height: calc(100% - 80px);
- position: relative;
- }
- .item-chart-word{
- font-size: 16px;
- }
- .zongshu{
- color:rgb(0, 253, 250);
- }
- .zaixianshu{
- color:rgb(7, 247, 168);
- }
- .lixianshu{
- color:rgb(227, 179, 55);
- }
- .gaojingshu{
- color:rgb(245, 2, 61);
- }
- }
- }
- </style>
|