当前位置:网站首页>双立体柱状图/双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);
},
},
边栏推荐
- 北京大学ACM Problems 1000:A+B Problem
- 软工UML画图
- C文件指针
- Dynamic style binding --style and class
- Vite2兼容低版本chrome(如搜狗80),通过polyfills处理部分需求高版本的语法
- Encoding type of Perl conversion file
- Lingyun going to sea | 10 leap &huawei cloud: jointly helping Africa with inclusive financial services
- 北京大学ACM Problems 1006:Biorhythms
- vncserver: Failed command ‘/etc/X11/Xvnc-session‘: 256!
- How can I get the stock account opening discount link? In addition, is it safe to open a mobile account?
猜你喜欢

哈夫曼树(一)基本概念与C语言实现

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

PHP obtains opcode and C source code

Huffman Tree (1) Basic Concept and C - language Implementation

Lumiprobe copper free click chemical solution

CentOS - enable / disable Oracle

注册设备监理师难考吗,和监理工程师有什么关系?

Study on lumiprobe modified triphosphate biotin-11-utp

1. Introduction to generating countermeasures network

阿里kube-eventer mysql sink简单使用记录
随机推荐
Study on lumiprobe modified triphosphate biotin-11-utp
SqlServer 获取字符串中数字,中文及字符部分数据
关于,奇安信检测代码漏洞,XSS系列解决
Lumiprobe细胞生物学丨DiA,亲脂性示踪剂说明书
减少嵌入式软件调试时间的三个技巧
请问海量数据如何去取最大的K个
Amazon restricts LGBTQ related search and product sales in the United Arab Emirates
北京大学ACM Problems 1000:A+B Problem
Peking University ACM problems 1001:exposition
大学生研究生毕业找工作,该选择哪个方向?
Deflection lock / light lock / heavy lock lock is healthier. How to complete locking and unlocking
AVL balanced binary tree (I) - concept and C language implementation
动态样式绑定--style 和 class
Gartner聚焦中国低代码发展 UniPro如何践行“差异化”
Lvalue reference and lvalue reference
sqlserver 字符串类型转换成小数或者整数类型
STL的基本组成部分
PHP获取Opcode及C源码
毕业设计
请指教在线开户需要什么银行卡?另外想问,现在在线开户安全么?