echarts 树形图 基于vue
效果如图
父组件
<template><div><tree-chart></tree-chart></div>
</template>
<script>
import treeChart from "@/views/my_components/charts/treeChart";
export default {components: { treeChart },data() {return {};},created() {},methods: {},
};
</script>
子组件
<template><div :class="className" :style="{ height: height, width: width }" />
</template><script>
import echarts from "echarts";
require("echarts/theme/macarons"); // echarts theme
// import resize from './mixins/resize'const animationDuration = 6000;export default {// mixins: [resize],props: {className: {type: String,default: "chart",},width: {type: String,default: "100%",},height: {type: String,default: "500px",},// chartData: {// type: Object,// required: true// }},data() {return {chart: null,};},mounted() {setTimeout(() => {this.initChart();}, 400);},beforeDestroy() {if (!this.chart) {return;}this.chart.dispose();this.chart = null;},methods: {initChart() {this.chart = echarts.init(this.$el, "macarons");this.setOptions(this.chartData);},setOptions({seriesData,chartTitleText,chartTitleColor,chartTitleFontSize,} = {}) {this.chart.setOption({// title: {// text: "手机品牌",// subtext: "子标题",// textStyle: {// color: chartTitleColor || "#333", // 文字颜色// fontSize: chartTitleFontSize || 14, // 文字大小// },// },tooltip: {trigger: "item",triggerOn: "mousemove",},series: [{type: "tree",orient: "vertical",top: "10%",left: "8%",bottom: "22%",right: "20%",edgeShape: "polyline", //折线lineStyle: {width: 1,// color: "#000",// type: "solid", // 'curve'|'broken'|'solid'|'dotted'|'dashed'},label: {//每个节点的labelbackgroundColor: "#F0F2F5",position: "left",verticalAlign: "middle",align: "right",},data: [{name: "手机",value: 6,symbolSize: [70, 70],//图片大小symbol:'image://' + require('@/assets/logo/logo.png'),// 使用本地图片// "image://https://iconfont.alicdn.com/t/1d7c8230-c6f9-4698-8224-3a575fe1fb43.png",// itemStyle: {// normal: {// label: {// show: false// }// }// },children: [{name: "小米",value: 4,symbol:"image://https://iconfont.alicdn.com/t/1d7c8230-c6f9-4698-8224-3a575fe1fb43.png",symbolSize: [60, 60],children: [{name: "小米1",symbol: "circle",symbolSize: 20,value: 4,itemStyle: {normal: {color: "#fa6900",label: {show: true,position: "right",},},emphasis: {label: {show: false,},borderWidth: 0,},},},{name: "小米2",value: 4,symbol: "circle",symbolSize: 20,itemStyle: {normal: {label: {show: true,position: "right",formatter: "{b}",},color: "#fa6900",borderWidth: 2,borderColor: "#cc66ff",},emphasis: {borderWidth: 0,},},},{name: "小米3",value: 2,symbol: "circle",symbolSize: 20,itemStyle: {normal: {label: {position: "right",},color: "#fa6900",brushType: "stroke",borderWidth: 1,borderColor: "#999966",},emphasis: {borderWidth: 0,},},},],},{name: "苹果",symbol:"image://http://www.viastreaming.com/images/apple_logo2.png",symbolSize: [60, 60],value: 4,},{name: "华为",symbol:"image://https://iconfont.alicdn.com/t/1d7c8230-c6f9-4698-8224-3a575fe1fb43.png",symbolSize: [60, 60],value: 2,},{name: "联想",symbol:"image://https://iconfont.alicdn.com/t/1d7c8230-c6f9-4698-8224-3a575fe1fb43.png",symbolSize: [60, 60],value: 2,},],},],},],});},},
};
</script>
echarts 树形图 基于vue相关推荐
- vue中基于echarts和基于高德地图的两种地图下钻与上浮方式
** vue中基于echarts和基于高德地图的两种地图下钻与上浮方式 ** 基于echarts的地图下钻与上浮(浙江省为例) 第一步:在<template>中构建承载echarts的do ...
- vue 雷达扫描_GitHub - suneildve/vueDataV: 基于Vue + Echarts 构建的数据可视化平台,酷炫大屏展示模板和组件库,持续更新各行各业实用模板和炫酷小组件。...
前言 一个基于Vue前端框架和第三方图表库echarts构建的可视化大数据平台,通过vue项目构建.指令的灵活运用.组件封装.组件之间通信,使内部图表组件库可实现自由替换和组合. 项目中部分前端库采用 ...
- vue-element-admin台前端解决方案: 基于 vue 和 element-ui实现
介绍 vue-element-admin 是一个后台前端解决方案,它基于 vue 和 element-ui实现.它使用了最新的前端技术栈,内置了 i18 国际化解决方案,动态路由,权限验证,提炼了典型 ...
- vue族谱架构_基于 Vue 实现动态家谱图/组织结构图
Vue-Tree-Chart 最近一个项目里有个前端绘制家谱图的需求,大概是下面这个样子: 点击节点会弹出操作菜单,实现增删改查等操作,查阅网上资料发现,现有案例基本都是基于orgchart这个jQu ...
- vue部门结构图_基于 Vue 实现动态组织结构图
基于 Vue 实现动态组织结构图 最近一个项目里有个前端绘制家谱图的需求, 大概是下面这个样子: 点击节点会弹出操作菜单, 实现增删改查等操作, 查阅网上资料发现, 现有案例基本都是基于 orgcha ...
- 基于 Vue JS、Element UI、Nuxt JS的项目PC端前端手册
基于 Vue JS.Element UI.Nuxt JS的项目PC端前端手册 前言:笔记写于2020年5月左右,刚开始做前端时整理的笔记 1.环境搭建 1.安装nodeJs 官网下载地址:http ...
- Vue的使用 -- 基于Vue搭建前端页面
Vue的使用 – 基于Vue搭建前端页面 首先,用到的前端技术只有 Vue.Element-ui.axios.Echarts,至于其它的技术点,我一个后端很少接触. 其次,Echarts 我也不怎么会 ...
- 基于Vue和SpringBoot的电商管理系统的设计与实现
作者主页:Designer 小郑 作者简介:Java全栈软件工程师一枚,来自浙江宁波,负责开发管理公司OA项目,专注软件前后端开发(Vue.SpringBoot和微信小程序).系统定制.远程技术指导. ...
- 基于Vue的高德离线地图开发--省市县
基于Vue的高德离线地图 离线地图优势 环境需要 下载地图离线资源包 本项目功能 具体代码 离线地图优势 高德地图接口,个人每天免费调用次数为500次,渲染速度受网络波动影响,又或许项目部署在局域网, ...
最新文章
- 比特币现金仍然是一个比较好的投资
- python快速入门答案-Python快速入门(一)
- 小余学调度:调度指令票系列讲解1(持续更新中ing)
- 重磅!Nature盘点年度十佳论文,生命科学占据半壁江山,中国学者表现亮眼
- 惯性导航算法_自动驾驶关键技术报告:惯性导航和背后的芯片大战
- java中两种遍历集合的方式_Java中Map集合的两种遍历方式
- 什么?云数据库也能C位出道?
- 点云配准1:配准基础及icp算法
- 微信小程序做出 物流签收信息(步骤条) 源码
- 【英语四六级-必背单词】高中英语单词 (H)-MP3试听与下载
- ONVIF系列——海康摄像头设置onvif协议开启
- flag计算机领域的意思,flag是什么意思
- 苹果mac电脑如何安装虚拟机?CrossOver Mac2022
- 记一次feign调用报错:feign.codec.DecodeException: Error while extracting response for type [java...
- 爱普生Epson SureColor T5480 打印机驱动
- 集成旷世人脸检测demo
- Python的特点及数据的存储单位(¥4)
- 企业软件投资:逆势穿越周期,重回黄金时代
- android 获取类对象(代码片段)
- ubuntu系统安全UFW
热门文章
- 2023年中国软件开发公司排行榜最新排名第一
- 学习LaTeX数学公式的一些常用函数
- springboot接入华为微服务引擎CSE全过程及后续遇到的问题一览
- 瑞士卢加诺大学(USI) Dynamic Analysis Group 博士招生
- IDEA配置自带的Maven
- 利用xss平台的payload输入留言即可获得flag
- PS2022版本修复打开闪退问题
- Centos7:Failed to start LSB: Bring up/down networking
- IDEA汉化后怎么setting打不开了?
- GraphConvolutionalNetworksforTextClassification 代码笔记