当前位置:网站首页>双立体柱状图/双y轴
双立体柱状图/双y轴
2022-06-30 20:41:00 【a٩(๑ʊ始于ʃʃʃ繁华ʊ๑)۶a】

methods: {
talentsEcharts() {
// 基于准备好的dom,初始化echarts实例
const chart = this.$echarts.init(this.$refs.lineEcharts);
let option = {
tooltip: {
backgroundColor: "none", //背景颜色(此时为默认色)
borderColor: "#099697",
textStyle: {
color: "#fff", align: "left" },
trigger: "axis",
axisPointer: {
crossStyle: {
color: "#fff",
},
},
},
// 图在元素中的位置
grid: {
top: "10%",
bottom: "0%",
left: "0%",
right: "0%",
containLabel: true,
height: 155,
},
xAxis: [
{
axisTick: {
show: false, //坐标轴刻度线
},
type: "category",
data: ["2018", "2019", "2020", "2021"],
axisLabel: {
textStyle: {
color: "#fff",
},
},
axisPointer: {
type: "shadow",
},
},
],
yAxis: [
// 左侧y轴
{
type: "value",
splitLine: {
show: false,
lineStyle: {
width: 0.3,
},
},
axisLine: {
show: false,
},
axisTick: {
show: false,
},
axisLabel: {
interval: 0,
color: "#fff",
fontSize: 12,
formatter: "{value} 亿",
},
splitArea: {
show: false,
},
},
// 右侧y轴
{
type: "value",
// 内部横线
splitLine: {
show: true,
lineStyle: {
width: 0.3,
},
},
axisLine: {
show: false,
},
axisTick: {
show: false,
},
// 单位
axisLabel: {
interval: 0,
color: "#fff",
fontSize: 12,
formatter: "{value} 家",
},
splitArea: {
show: false,
},
},
],
series: [
// 第一个柱子
{
//柱底圆片
name: "",
type: "pictorialBar",
yAxisIndex: 0,
symbolSize: [15, 11], //调整截面形状
// 调整截面的位置
// 在添加或删除柱子时需要调整配置
symbolOffset: [-7.5, 5],
z: 12,
itemStyle: {
normal: {
color: "#25A0D0",
},
},
tooltip: {
show: false,
},
data: ["3719.40", "2288.29", "1852.65", "1425.12"],
},
//柱体
{
name: "",
type: "bar",
yAxisIndex: 0,
barWidth: 15,
barGap: "0%",
itemStyle: {
normal: {
color: "#25A0D0",
// 加上透明度才会有立体的感觉和上下圆截面才能有对比
opacity: 0.7,
},
},
tooltip: {
valueFormatter: function (value) {
return value + " 亿";
},
},
data: ["1425.12", "1852.65", "2288.29", "3719.40"],
},
//柱顶圆片
{
name: "",
type: "pictorialBar",
yAxisIndex: 0,
symbolSize: [15, 11], //调整截面形状
symbolOffset: [-7.5, -5],
z: 12,
symbolPosition: "end",
itemStyle: {
normal: {
color: "#25A0D0",
},
},
tooltip: {
show: false,
},
data: ["1425.12", "1852.65", "2288.29", "3719.40"],
},
// 第二个柱子
{
//柱底圆片
name: "",
type: "pictorialBar",
yAxisIndex: 1,
symbolSize: [15, 11], //调整截面形状
symbolOffset: [7.5, 4],
z: 12,
itemStyle: {
normal: {
color: "#18E6BA",
},
},
tooltip: {
show: false,
},
data: ["2903", "4133", "5085", "6221"],
},
//右边柱体
{
name: "",
type: "bar",
yAxisIndex: 1,
barWidth: 15,
barGap: "0%",
itemStyle: {
normal: {
color: "#18E6BA",
opacity: 0.7,
},
},
tooltip: {
valueFormatter: function (value) {
return value + " 家";
},
},
data: ["2903", "4133", "5085", "6221"],
},
//柱顶圆片
{
name: "",
type: "pictorialBar",
yAxisIndex: 1,
symbolSize: [15, 11],
symbolOffset: [7.5, -4],
z: 12,
symbolPosition: "end",
itemStyle: {
normal: {
color: "#18E6BA",
},
},
tooltip: {
show: false,
},
data: ["2903", "4133", "5085", "6221"],
},
],
};
chart.setOption(option);
},
},
边栏推荐
- B_QuRT_User_Guide(33)
- 1.微信小程序页面跳转方法总结;2. navigateTo堆栈到十层不跳转问题
- B_QuRT_User_Guide(32)
- unittest自动测试多个用例时,logging模块重复打印解决
- ncat详细介绍(转载)
- vncserver: Failed command ‘/etc/X11/Xvnc-session‘: 256!
- 开发技术-获取10分钟前的时间
- PHP require/include differences
- 数据库 OLAP、OLTP是什么?相同和不同?适用场景
- Wechat applet development practice cloud music
猜你喜欢

On the charm of code language

阿里kube-eventer mysql sink简单使用记录

软工UML画图

Lumiprobe copper free click chemical solution

Lumiprobe 改性三磷酸盐丨生物素-11-UTP研究

【数字IC应届生职业规划】Chap.1 IC行业产业链概述及代表企业大厂汇总

Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource could

Implementation principle of PostgreSQL heap table storage engine

Lambda expression principle analysis and learning (June 23, 2022)

为什么vscode用久了电脑速度变慢?
随机推荐
二叉查找树(一) - 概念与C语言实现
Lumiprobe nucleic acid quantitative qudye dsDNA br detection kit
Common questions and answering skills of project manager interview
All the important spark summit features were released here last night (with ultra clear video attached)
Analysis of breakpoint continuation and download principle
Go语学习笔记 - gorm使用 - 数据库配置、表新增 | Web框架Gin(七)
Lumiprobe细胞生物学丨DiA,亲脂性示踪剂说明书
Encoding type of Perl conversion file
判断js对象是否为空的方式
No "history of blood and tears" in home office | community essay solicitation
B_QuRT_User_Guide(35)
Game 81 biweekly
报错:Internal error XFS_WANT_CORRUPTED_GOTO at line 1635 of file fs/xfs/libxfs/xfs_alloc.c.
股票开户优惠链接,我如何才能得到?另外,手机开户安全么?
B_QuRT_User_Guide(34)
AVL balanced binary tree (I) - concept and C language implementation
Peking University ACM problems 1002:487-3279
On inline function
Dynamic style binding --style and class
Document contains & conditional competition