uniapp+echarts开发APP版本教程

需求

需要在uniapp+echarts展示图表功能,是APP版本,不是小程序。找了好多教程都乱七八糟的,无法实现。以下是效果图

教程

1、安装插件

HBuilder安装echarts插件,插件地址如下。安装完成后在uni_modules/lime-echart文件夹下

https://ext.dcloud.net.cn/plugin?id=4899

2,代码

<template><view class="app-container" style="padding-bottom: 0;"><view class="myBody"><uni-row style="margin-top: 20px;"><uni-col :span="24"><view style="width: 100%; height: 220px;background: #fafafa;"><l-echart ref="deviceTypesChart" @finished="deviceTypeInit"></l-echart></view></uni-col></uni-row></view></view></template>
<script>import * as echarts from '@/uni_modules/lime-echart/static/echarts.min';export default {name: "IndexPhone",components: {},data() {return {}},created() {},onReady() {},onLoad() {},methods: {deviceTypeInit() {var _this = this;uni.request({url: _this.api + '/getDeviceStatusNum',method: 'get',data: '',header: {'Content-Type': 'application/json','Authorization': "Bearer " + uni.getStorageSync("loginToken"),'language': uni.getStorageSync("flowinnIotLanguage")},success: function(res) {var response = res.data;let deviceTypes = response.rows;let option = {tooltip: {trigger: 'item'},legend: {top: '3px',left: 'center'},// 关闭,远控,禁用,近控color:['#a0a1a3','#4fb989','#f55b83','#58c3fb'],series: [{name: "设备使能状态统计",type: 'pie',radius: ['38%', '60%'],avoidLabelOverlap: false,itemStyle: {borderRadius: 10,borderColor: '#fff',borderWidth: 2},label: {show: false,position: 'center'},emphasis: {label: {show: true,fontSize: 20,fontWeight: 'bold'}},labelLine: {show: false},data: deviceTypes}]};_this.$refs.deviceTypesChart.init(echarts, chartObj => {chartObj.setOption(option);});},fail: function(err) {console.error(err);}});},},mounted() {},};
</script><style rel="stylesheet/scss"></style>

3、option官网

打开echarts官网,然后选择自己的图表

https://echarts.apache.org/examples/zh/index.html

打开后, 直接复制option,然后替换data就行。

 

结束

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

package cn.renkai721.bean.vo;import lombok.extern.slf4j.Slf4j;@Slf4j
public class MakeUpTheWordCount {private String make_up_the_word_count_column_999999999_1;private String make_up_the_word_count_column_999999999_2;private String make_up_the_word_count_column_999999999_3;private String make_up_the_word_count_column_999999999_4;private String make_up_the_word_count_column_999999999_5;private String make_up_the_word_count_column_999999999_6;private String make_up_the_word_count_column_999999999_7;private String make_up_the_word_count_column_999999999_8;private String make_up_the_word_count_column_999999999_9;private String make_up_the_word_count_column_999999999_10;private String make_up_the_word_count_column_999999999_11;private String make_up_the_word_count_column_999999999_12;private String make_up_the_word_count_column_999999999_13;private String make_up_the_word_count_column_999999999_14;private String make_up_the_word_count_column_999999999_15;private String make_up_the_word_count_column_999999999_16;private String make_up_the_word_count_column_999999999_17;private String make_up_the_word_count_column_999999999_18;private String make_up_the_word_count_column_999999999_19;private String make_up_the_word_count_column_999999999_20;public String getMake_up_the_word_count_column_999999999_1() {return make_up_the_word_count_column_999999999_1;}public void setMake_up_the_word_count_column_999999999_1(String make_up_the_word_count_column_999999999_1) {this.make_up_the_word_count_column_999999999_1 = make_up_the_word_count_column_999999999_1;}public String getMake_up_the_word_count_column_999999999_2() {return make_up_the_word_count_column_999999999_2;}public void setMake_up_the_word_count_column_999999999_2(String make_up_the_word_count_column_999999999_2) {this.make_up_the_word_count_column_999999999_2 = make_up_the_word_count_column_999999999_2;}public String getMake_up_the_word_count_column_999999999_3() {return make_up_the_word_count_column_999999999_3;}public void setMake_up_the_word_count_column_999999999_3(String make_up_the_word_count_column_999999999_3) {this.make_up_the_word_count_column_999999999_3 = make_up_the_word_count_column_999999999_3;}public String getMake_up_the_word_count_column_999999999_4() {return make_up_the_word_count_column_999999999_4;}public void setMake_up_the_word_count_column_999999999_4(String make_up_the_word_count_column_999999999_4) {this.make_up_the_word_count_column_999999999_4 = make_up_the_word_count_column_999999999_4;}public String getMake_up_the_word_count_column_999999999_5() {return make_up_the_word_count_column_999999999_5;}public void setMake_up_the_word_count_column_999999999_5(String make_up_the_word_count_column_999999999_5) {this.make_up_the_word_count_column_999999999_5 = make_up_the_word_count_column_999999999_5;}public String getMake_up_the_word_count_column_999999999_6() {return make_up_the_word_count_column_999999999_6;}public void setMake_up_the_word_count_column_999999999_6(String make_up_the_word_count_column_999999999_6) {this.make_up_the_word_count_column_999999999_6 = make_up_the_word_count_column_999999999_6;}public String getMake_up_the_word_count_column_999999999_7() {return make_up_the_word_count_column_999999999_7;}public void setMake_up_the_word_count_column_999999999_7(String make_up_the_word_count_column_999999999_7) {this.make_up_the_word_count_column_999999999_7 = make_up_the_word_count_column_999999999_7;}public String getMake_up_the_word_count_column_999999999_8() {return make_up_the_word_count_column_999999999_8;}public void setMake_up_the_word_count_column_999999999_8(String make_up_the_word_count_column_999999999_8) {this.make_up_the_word_count_column_999999999_8 = make_up_the_word_count_column_999999999_8;}public String getMake_up_the_word_count_column_999999999_9() {return make_up_the_word_count_column_999999999_9;}public void setMake_up_the_word_count_column_999999999_9(String make_up_the_word_count_column_999999999_9) {this.make_up_the_word_count_column_999999999_9 = make_up_the_word_count_column_999999999_9;}public String getMake_up_the_word_count_column_999999999_10() {return make_up_the_word_count_column_999999999_10;}public void setMake_up_the_word_count_column_999999999_10(String make_up_the_word_count_column_999999999_10) {this.make_up_the_word_count_column_999999999_10 = make_up_the_word_count_column_999999999_10;}public String getMake_up_the_word_count_column_999999999_11() {return make_up_the_word_count_column_999999999_11;}public void setMake_up_the_word_count_column_999999999_11(String make_up_the_word_count_column_999999999_11) {this.make_up_the_word_count_column_999999999_11 = make_up_the_word_count_column_999999999_11;}public String getMake_up_the_word_count_column_999999999_12() {return make_up_the_word_count_column_999999999_12;}public void setMake_up_the_word_count_column_999999999_12(String make_up_the_word_count_column_999999999_12) {this.make_up_the_word_count_column_999999999_12 = make_up_the_word_count_column_999999999_12;}public String getMake_up_the_word_count_column_999999999_13() {return make_up_the_word_count_column_999999999_13;}public void setMake_up_the_word_count_column_999999999_13(String make_up_the_word_count_column_999999999_13) {this.make_up_the_word_count_column_999999999_13 = make_up_the_word_count_column_999999999_13;}public String getMake_up_the_word_count_column_999999999_14() {return make_up_the_word_count_column_999999999_14;}public void setMake_up_the_word_count_column_999999999_14(String make_up_the_word_count_column_999999999_14) {this.make_up_the_word_count_column_999999999_14 = make_up_the_word_count_column_999999999_14;}public String getMake_up_the_word_count_column_999999999_15() {return make_up_the_word_count_column_999999999_15;}public void setMake_up_the_word_count_column_999999999_15(String make_up_the_word_count_column_999999999_15) {this.make_up_the_word_count_column_999999999_15 = make_up_the_word_count_column_999999999_15;}public String getMake_up_the_word_count_column_999999999_16() {return make_up_the_word_count_column_999999999_16;}public void setMake_up_the_word_count_column_999999999_16(String make_up_the_word_count_column_999999999_16) {this.make_up_the_word_count_column_999999999_16 = make_up_the_word_count_column_999999999_16;}public String getMake_up_the_word_count_column_999999999_17() {return make_up_the_word_count_column_999999999_17;}public void setMake_up_the_word_count_column_999999999_17(String make_up_the_word_count_column_999999999_17) {this.make_up_the_word_count_column_999999999_17 = make_up_the_word_count_column_999999999_17;}public String getMake_up_the_word_count_column_999999999_18() {return make_up_the_word_count_column_999999999_18;}public void setMake_up_the_word_count_column_999999999_18(String make_up_the_word_count_column_999999999_18) {this.make_up_the_word_count_column_999999999_18 = make_up_the_word_count_column_999999999_18;}public String getMake_up_the_word_count_column_999999999_19() {return make_up_the_word_count_column_999999999_19;}public void setMake_up_the_word_count_column_999999999_19(String make_up_the_word_count_column_999999999_19) {this.make_up_the_word_count_column_999999999_19 = make_up_the_word_count_column_999999999_19;}public String getMake_up_the_word_count_column_999999999_20() {return make_up_the_word_count_column_999999999_20;}public void setMake_up_the_word_count_column_999999999_20(String make_up_the_word_count_column_999999999_20) {this.make_up_the_word_count_column_999999999_20 = make_up_the_word_count_column_999999999_20;}
}

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

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

相关文章

12.2 【Screen配置】khronos模块配置

一,khronos配置配置简介 khronos部分的配置用于指定与Khronos相关的库和参数(例如EGL和WFD库)。 在graphics.conf配置文件中,khronos部分指定GPU和显示驱动程序。只有在系统需要这两种类型的驱动程序之一或两者时,才需要在配置文件中包含此部分。khronos部分由begin khr…

使用169.254开头的IP地址

介绍&#xff1a; 在计算机网络中&#xff0c;当设备无法通过DHCP服务器获取有效的IP地址时&#xff0c;它会尝试使用自动私有IP地址&#xff08;APIPA&#xff09;来分配一个本地链接的IP地址。APIPA地址范围从169.254.0.1到169.254.255.254。这篇文档将介绍关于使用以169.254…

主板部件

▶1.主要部件 主板是计算机的重要部件&#xff0c;主板由集成电路芯片、电子元器件、电路系统、各种总线插座和接口组成&#xff0c;目前主板标准为ATX。主板的主要功能是传输各种电子信号&#xff0c;部分芯片负责初步处理一些外围数据。不同类型的CPU,需要不同主板与之匹配。…

微信小程序+前后端开发学习材料

目录结构 全局文件 1.app.json 文件 用来对微信小程序进行全局配置&#xff0c;决定页面文件的路径、窗口表现、设置网络超时时间、设置多 tab 等。文件内容为一个 JSON 对象。 1.1 page用于指定小程序由哪些页面组成&#xff0c;每一项都对应一个页面的 路径&#xff08;含文…

docker镜像仓库详解(Docker Registry)

本片文章主要是对docker的镜像仓库进行了详解。其中包含了一些常用了 docker 指令&#xff0c;通过举例进行详解。也详细解释了镜像仓库的工作机制和常见的镜像仓库。也实际拉去和运行了一些镜像。希望本篇文章会对你有所帮助&#xff01; 文章目录 一、什么是Docker Registry …

【卡梅德生物】杂交瘤技术、噬菌体展示技术和兔单B细胞技术制备兔单抗的对比

兔单克隆抗体技术的演进经历了杂交瘤技术、噬菌体展示技术和单B细胞技术三个关键阶段。这些技术的不断进步推动了兔单克隆抗体技术的优化&#xff0c;显著提高了抗体的生产效率、特异性和适用范围。在科研和医药领域&#xff0c;兔单克隆抗体技术因其不断发展的特性而取得了令人…

Java IO流(三)-字节流缓冲流

1字节缓冲区流 1.1 字节缓冲流概述 字节缓冲流&#xff1a; ​ BufferOutputStream&#xff1a;缓冲输出流​ BufferedInputStream&#xff1a;缓冲输入流 构造方法&#xff1a; ​ 字节缓冲输出流&#xff1a;BufferedOutputStream(OutputStream out)​ 字节缓冲输入流&…

Nginx 中 return 和 rewrite 跳转

目录 1.return 跳转 2.rewrite 跳转 如果把https的s去掉&#xff0c;就相当于去访问80端口了&#xff0c;https默认找的是443端口&#xff0c;而80端 口对应的网站我们设置了默认网站&#xff0c;所以如果你删掉了s再访问&#xff0c;就看到我们的默认网站了 我们想要的效果…

LeetCode 1154. 一年中的第几天:2023年最后一道每日一题

【LetMeFly】1154.一年中的第几天&#xff1a;2023年最后一道每日一题 力扣题目链接&#xff1a;https://leetcode.cn/problems/day-of-the-year/ 给你一个字符串 date &#xff0c;按 YYYY-MM-DD 格式表示一个 现行公元纪年法 日期。返回该日期是当年的第几天。 示例 1&…

Python办公自动化 – 定时邮件提醒和音视频文件处理

Python办公自动化 – 定时邮件提醒和音视频文件处理 以下是往期的文章目录&#xff0c;需要可以查看哦。 Python办公自动化 – Excel和Word的操作运用 Python办公自动化 – Python发送电子邮件和Outlook的集成 Python办公自动化 – 对PDF文档和PPT文档的处理 Python办公自动化…

网工内推 | 事业单位、上市公司网工,五险一金补贴多

01 中科中山药物创新研究院 招聘岗位&#xff1a;网络工程师 职责描述&#xff1a; 1.负责信息化网络数据安全&#xff0c;加固网络安全、渗透测试、风险评估、漏洞扫描、风险管理和风险评估方法。对防火墙、IDS、IPS、蜜罐、防DDOS、VPN等设备的运行管理&#xff1b; 2.负责机…

100个python代码大全详细介绍

1.输出Hello World print("Hello World!")2.计算两个数的和 num1 5 num2 7 sum num1 num2 print("The sum of", num1, "and", num2, "is", sum)3.判断一个数是否是正数 num 10 if num > 0:print("Positive number&quo…

CodeWave智能开发平台--03--目标:应用创建--01模板创建依赖问题修改

摘要 本文是网易数帆CodeWave智能开发平台系列的第03篇&#xff0c;主要介绍了基于CodeWave平台文档的新手入门进行学习&#xff0c;实现一个完整的应用&#xff0c;本文主要完成模板创建时的依赖问题解决。 CodeWave智能开发平台的03次接触 CodeWave参考资源 网易数帆Code…

脚本接收参数,执行shell指令

洗礼 上午开完会&#xff0c;5个小时内丧失思考行动能力&#xff0c;10个小时内不敢说话&#xff0c;深刻把握会议精神&#xff0c;反省自己。因为经常用到脚本执行任务&#xff0c;所以记录一下一些常用的脚本接收参数&#xff0c;执行shell指令。 python脚本 Python脚本是…

vercel部署Gemini pro

一、注册一个vercel账号&#xff08;这个东西类似于第三方的github pages&#xff0c;能部署github中的项目&#xff09; 二、注册结束后&#xff0c;填写github的账号&#xff08;需要事先在该github账号中fork一个gemini的repository&#xff09; 三、babaohuang/GeminiPro…

应用案例——楼宇对讲、可视门铃芯片组成分析

语音通话芯片&#xff1a;D34018,D34118,D5020,D31101; D34018 单片电话机通话电路&#xff0c;合并了必 需的放大器、衰减器和几种控制 功能&#xff0c;包括发送和接收衰减器、 背景噪声电平检测系统和一个衰 减器控制系统&#xff0c;对发送和接收电 平好于背景噪声做…

git的使用 笔记1

GIT git的使用 使用git提交的两步 第一步&#xff1a;是使用 git add 把文件添加进去&#xff0c;实际上就是把文件添加到暂存区。第二步&#xff1a;使用git commit提交更改&#xff0c;实际上就是把暂存区的所有内容提交到当前分支上。 .git 跟踪管理版本的目录 创建版本库…

阶段十-分布式-Redis01

第一章 Redis入门 1.1 节 什么是NoSql型数据库 NoSQL ,泛指非关系型的数据库, NoSQL Not Only SQL,它可以作为关系型数据库的良好补充。 NoSQL 不依赖业务逻辑方式存储&#xff0c;而以简单的key-value模式存储。因此大大的增加了数据库的扩展能力。NoSQL与SQL数据库区别对比如…

【Kubernetes 】Kubernetes 网络之 Ingress 配置详解

一、ingress 在Kubernetes集群中,Ingress作为集群内服务对外暴露的访问接入点,几乎承载着集群内服务访问的所有流量。Ingress是Kubernetes中的一个资源对象,用来管理集群外部访问集群内部服务的方式。可以通过Ingress资源来配置不同的转发规则,从而实现根据不同的规则设置访…

CMake入门教程【核心篇】包含目录(include_directories)

&#x1f608;「CSDN主页」&#xff1a;传送门 &#x1f608;「Bilibil首页」&#xff1a;传送门 &#x1f608;「本专栏容」&#xff1a;CMake入门教程 &#x1f608;「动动你的小手」&#xff1a;点赞&#x1f44d;收藏⭐️评论&#x1f4dd; 文章目录 1. 基本用法2. 添加单个…