【Vue+Element-plus】记录后台首页多echart图静态页面

一、页面效果

二、完整代码

 Index.vue


<template><div><div><DateTime /><!-- {{username}} --></div><el-row :gutter="20"><el-col :span="8"><div class="grid-content bg-purple"><PeopleNum /></div></el-col><el-col :span="8"><div class="grid-content bg-purple"><TrackPatients /></div></el-col><el-col :span="8"><div class="grid-content bg-purple"><HealPatients /></div></el-col></el-row><el-row :gutter="20"><el-col :span="12"><div class="grid-content bg-purple"><DataComparison /></div></el-col><el-col :span="12"><div class="grid-content bg-purple"><VisitsNumber /> <Text></Text></div></el-col></el-row><el-row :gutter="20"><el-col :span="6"><div class="grid-content bg-purple"><Text></Text></div></el-col><el-col :span="12"><div class="grid-content bg-purple"></div></el-col><el-col :span="6"><div class="grid-content bg-purple"></div></el-col></el-row><Text></Text></div>
</template><script>
import DateTime from "@/components/HomeChart/DateTime.vue";
import PeopleNum from "@/components/HomeChart/PeopleNumber.vue";
import TrackPatients from "@/components/HomeChart/TrackPatients.vue";
import HealPatients from "@/components/HomeChart/HealPatient.vue";
import DataComparison from "@/components/HomeChart/DataComparison.vue";
import VisitsNumber from "@/components/HomeChart/VisitsNumber.vue";export default {name: "home",components: {DateTime,PeopleNum,TrackPatients,HealPatients,DataComparison,VisitsNumber,},data() {return {};},methods: {},created() {}
};
</script><style lang="less" scoped>
.el-row {margin-bottom: 20px;&:last-child {margin-bottom: 10px;}
}.el-col {border-radius: 4px;
}.bg-purple-dark {background: #99a9bf;
}.bg-purple {background: #d3dce6;
}.bg-purple-light {background: #e5e9f2;
}.grid-content {border-radius: 13px;min-height: 150px;margin: 15px 12px 0px 12px;
}.row-bg {padding: 10px 0;background-color: #f9fafc;
}
</style>

 DataComparison.vue

<template><div><el-card class="box-card"><div slot="header" class="clearfix"><span>粉丝数量排名前五城市</span><el-button style="float: right; padding: 3px 0" type="text"><i class="el-icon-more"></i></el-button></div><div id="charts4" style="width: 460px; height: 220px"></div><!-- <div v-for="o in 4" :key="o" class="text item">{{ "列表内容 " + o }}</div> --></el-card></div>
</template><script>
import * as echarts from "echarts";export default {name: "HealPatients",data() {return {};},mounted() {let myChart4 = echarts.init(document.getElementById("charts4"));myChart4.setOption({tooltip: {trigger: 'axis',axisPointer: {// Use axis to trigger tooltiptype: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'}},legend: {},grid: {left: '3%',right: '4%',bottom: '3%',containLabel: true},xAxis: {type: 'value'},yAxis: {type: 'category',data: ['广州', '深圳', '上海', '重庆', '北京']},series: [{name: '原有粉丝',type: 'bar',stack: 'total',label: {// show: true},emphasis: {focus: 'series'},data: [820, 902, 901, 1134, 1390]},{// name: '良好人数',type: 'bar',stack: 'total',label: {// show: true},emphasis: {focus: 'series'},// data: [1233, 1142, 1041, 1344, 1940]},{// name: '111',type: 'bar',stack: 'total',label: {// show: true},emphasis: {focus: 'series'},// data: [220, 182, 191, 234, 290]},{// name: '',type: 'bar',stack: 'total',label: {// show: true},emphasis: {focus: 'series'},// data: [23, 28, 34, 39, 50]},{name: '新增粉丝',type: 'bar',stack: 'total',label: {// show: true},emphasis: {focus: 'series'},data: [150, 212, 201, 154, 190, 330, 410]}]});},
};
</script><style scoped>
span{font-size: 15px;
}.clearfix:before,
.clearfix:after {display: table;content: "";
}.clearfix:after {clear: both;
}.box-card {width: 480px;
}
</style>

DateTime.vue

<template><div><div class="today">今天,</div><div class="date">2023年3月12日星期日,欢迎您使用乐游后台管理平台。</div></div>
</template><script>
export default {data() {return {// date,};},methods: {// date() {}}
}
</script><style scoped>
.today{font-size: 38px;margin: 15px;
}
.date{margin: 15px;
}
</style>

HealPatient.vue

<template><div><el-card class="box-card"><span>一个占位的表</span><el-button style="float: right; padding: 3px 0" type="text"><i class="el-icon-more"></i></el-button><div id="charts3" style="width: 100%; height: 90px"></div></el-card></div>
</template><script>
import * as echarts from "echarts";export default {name: "HealPatients",data() {return {};},mounted() {let myChart3 = echarts.init(document.getElementById("charts3"));myChart3.setOption({xAxis: {type: "category",data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],},yAxis: {type: "value",},series: [{data: [6, 12, 10, 4, 12, 13, 10],type: "line",smooth: true,},],});},
};
</script><style scoped>
span {font-size: 15px;
}
.text {font-size: 12px;
}.item {margin-bottom: 50px;
}.clearfix:before,
.clearfix:after {display: table;content: "";
}
.clearfix:after {clear: both;
}
</style>

PeopleNumber.vur

<template><div><el-card class="box-card"><span>粉丝总数</span><!-- <div>追踪患者</div> --><el-button style="float: right; padding: 3px 0" type="text"><i class="el-icon-more"></i></el-button><div id="charts1" style="width: 100%; height: 90px"></div></el-card></div>
</template><script>
import * as echarts from "echarts";export default {name: "HealPatients",data() {return {};},mounted() {let myChart1 = echarts.init(document.getElementById("charts1"));myChart1.setOption({legend: {},tooltip: {},dataset: {source: [// ['product', '2015', '2016', '2017'],["1", 55],["2", 56],["3", 66],["4", 73],["5", 83],["6", 103],["7", 108],],},xAxis: { type: "category" },yAxis: {},// Declare several bar series, each will be mapped// to a column of dataset.source by default.series: [{ type: "bar" }],});},
};
</script><style  scoped>
span {font-size: 15px;
}
.text {font-size: 12px;
}.item {margin-bottom: 50px;
}.clearfix:before,
.clearfix:after {display: table;content: "";
}
.clearfix:after {clear: both;
}
</style>

TrackPatients.vue

<template><div><el-card class="box-card"><span>男女占比</span><!-- <div>追踪患者</div> --><el-button style="float: right; padding: 3px 0" type="text"><i class="el-icon-more"></i></el-button><div id="charts" style="width: 100%; height: 90px"></div></el-card></div>
</template><script>
import * as echarts from "echarts";export default {name: "TrackPatients",data(){return{}},mounted(){let myChart = echarts.init(document.getElementById('charts'));myChart.setOption({tooltip: {trigger: 'item'},legend: {top: '10%',orient: 'vertical',left: 'left'},series: [{name: 'Access From',type: 'pie',radius: ['40%', '70%'],avoidLabelOverlap: false,itemStyle: {borderRadius: 10,borderColor: '#fff',borderWidth: 2},label: {show: false,position: 'center'},emphasis: {label: {show: true,fontSize: 28,fontWeight: 'bold'}},labelLine: {show: false},data: [{ value: 67, name: '女' },{ value: 34, name: '男' },{ value: 13, name: '未知' },]}]})}}
</script><style  scoped>
span{font-size: 15px;
}.text {font-size: 12px;}.item {margin-bottom: 50px;}.clearfix:before,.clearfix:after {display: table;content: "";}.clearfix:after {clear: both}</style>

VisitsNumber.vue

<template><div><el-card class="box-card"><div slot="header" class="clearfix"><span>七天内新增用户</span><el-button style="float: right; padding: 3px 0" type="text"><i class="el-icon-more"></i></el-button></div><div id="charts5" style="width: 460px; height: 220px"></div></el-card></div>
</template><script>
import * as echarts from "echarts";export default {name: "HealPatients",data() {return {};},mounted() {let myChart5 = echarts.init(document.getElementById("charts5"));myChart5.setOption({tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'}},grid: {left: '3%',right: '4%',bottom: '3%',containLabel: true},xAxis: [{type: 'category',data: ['2023.03.09','2023.03.10','2023.03.11','2023.03.12','2023.03.13','2023.03.14','2023.03.15'],axisTick: {alignWithLabel: true}}],yAxis: [{type: 'value'}],series: [{name: 'Direct',type: 'bar',barWidth: '60%',data: [103, 122, 90, 127, 98, 102, 123]}]});},
};
</script><style  scoped>
span{font-size: 15px;
}.clearfix:before,
.clearfix:after {display: table;content: "";
}.clearfix:after {clear: both;
}.box-card {width: 480px;
}
</style>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/59506.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

聚焦智慧医疗-RK3566智能主板助力POCT领域

POCT又称即时检验&#xff0c;是IVD(体外诊断)行业的一个细分领域&#xff0c;是指在采样现场即刻进行的快速诊断&#xff0c;省去了标本在实验室检验的复杂处&#xff0c;利用便携式分析仪器及配套试剂快速得到检测结果的一种检测方式。常见的POCT设备有生化分析仪、免疫分析仪…

MySQL及SQL语句(3)

MySQL及SQL语句(3) 文章目录 MySQL及SQL语句(3)一、多表查询1.1 准备sql1.2 笛卡尔积1.3 多表查询的分类&#xff1a;内连接查询外连接查询子查询多表查询练习 二、事务2.1 事务的基本介绍概念操作实例事务提交的两种方式 2.2 事务的四大特征原子性持久性隔离性一致性 2.3 事务…

什么是Linux,如何在Windows操作系统下搭建Linux环境,远程连接Linux系统

文章目录 什么是LinuxLinux的诞生及发展为什么要学习LinuxLinux内核Linux发行版什么是虚拟机如何在VMware虚拟机中搭建Linux系统环境远程连接 Linux 系统Linux 帮助网站 什么是Linux Linux是一套免费使用和自由传播的类Unix操作系统&#xff0c;是一个基于POSIX和UNIX的多用户…

SpringBoot Web开发静态资源处理

Web开发探究 简介 其实SpringBoot的东西用起来非常简单&#xff0c;因为SpringBoot最大的特点就是自动装配 使用SpringBoot的步骤&#xff1a; 1、创建一个SpringBoot应用&#xff0c;选择我们需要的模块&#xff0c;SpringBoot就会默认将我们的需要的模块自动配置好 2、手动…

爬虫获取电影数据----以沈腾参演电影为例

数据可视化&分析实战 1.1 沈腾参演电影数据获取 文章目录 数据可视化&分析实战前言1. 网页分析2. 构建数据获取函数2.1 网页数据获取函数2.2 网页照片获取函数 3. 获取参演影视作品基本数据4. 电影详细数据获取4.1 导演、演员、描述、类型、投票人数、评分信息、电影海…

windows下redis的下载和安装

文章目录 1 下载2 打开解压文件&#xff0c;可以看到以下内容3 使用命令进行安装和注册redis到window服务4 查看服务 1 下载 https://github.com/MicrosoftArchive/redis/releases 2 打开解压文件&#xff0c;可以看到以下内容 3 使用命令进行安装和注册redis到window服务 …

ChatGPT 作为 Python 编程助手

推荐&#xff1a;使用 NSDT场景编辑器 助你快速搭建可编辑的3D应用场景 简单的数据处理脚本 我认为一个好的起点是某种数据处理脚本。由于我打算让 ChatGPT 之后使用各种 Python 库编写一些机器学习脚本&#xff0c;这似乎是一个合理的起点。 目标 首先&#xff0c;我想尝试…

异常的使用

第一章 异常 1、异常概念 异常&#xff0c;就是不正常的意思。在生活中&#xff1a;医生说&#xff0c;你的身体某个部位有异常&#xff0c;该部位和正常相比有点不同&#xff0c;该部位的功能将受影响&#xff0c;在程序中的意思就是&#xff1a; 异常&#xff1a;指的是程序…

【福利】免费白嫖Notability订阅版,无需越狱,支持无限笔记!

转载请注明出处&#xff1a;小锋学长生活大爆炸[xfxuezhang.cn] 视频教程&#xff1a;【福利】免费白嫖Notability订阅版&#xff0c;无需越狱&#xff0c;支持无限笔记&#xff01;_哔哩哔哩_bilibili 下载爱思助手 连接iPad 搜索并安装12.1.8版本的notability iPad上打开软件…

Unity 基础函数

Mathf&#xff1a; //1.π-PI print(Mathf.PI); //2.取绝对值-Abs print(Mathf.Abs(-10)); print(Mathf.Abs(-20)); print(Mathf.Abs(1)); //3.向上取整-Ce il To In t float f 1.3f; int i (int)f; …

springboot(4)

AOP 1.AOP与OOP OOP&#xff08;Object Oriented Programming&#xff0c;面向对象编程&#xff09; AOP&#xff08;Aspect Oriented Programming&#xff0c;面向切面编程&#xff09; POP&#xff08;Process Oriented Programming&#xff0c;面向过程编程&#xff09; …

网络防御(2)

1. 什么是防火墙&#xff1f; 2. 状态防火墙工作原理&#xff1f; 3. 防火墙如何处理双通道协议&#xff1f; 一、什么是防火墙&#xff1f; 防火墙是一种网络安全设备或软件&#xff0c;用于保护计算机网络免受未经授权的访问&#xff0c;并管理网络流量。它作为一个安全边界…