当前位置:网站首页>双立体柱状图/双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);
},
},
边栏推荐
- STL的基本组成部分
- Lumiprobe细胞生物学丨DiA,亲脂性示踪剂说明书
- Summary of personal work of 21 groups in the first week of summer training
- B_QuRT_User_Guide(32)
- Flinksql两个kafka 流可以进行join么?
- Study on lumiprobe modified triphosphate biotin-11-utp
- Lumiprobe cell biology - dia, instructions for lipophilic tracer
- DM8:生成DM AWR报告
- PHP require/include differences
- [1175. prime number arrangement]
猜你喜欢

PHP获取Opcode及C源码

Is the project manager a leader? Can you criticize and blame members?

Lumiprobe生物素亚磷酰胺(羟脯氨酸)说明书

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

SQL Server 提取字符串中的纯数字

左值引用和右值引用

Based on the open source stream batch integrated data synchronization engine Chunjun data restore DDL parsing module actual combat sharing

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

BioVendor sRAGE Elisa试剂盒测试原理和注意事项

1.微信小程序页面跳转方法总结;2. navigateTo堆栈到十层不跳转问题
随机推荐
Peking University ACM problems 1000:a+b problem
关于,奇安信检测代码漏洞,XSS系列解决
北京大学ACM Problems 1005:I Think I Need a Houseboat
SqlServer 获取字符串中数字,中文及字符部分数据
Lumiprobe核酸定量丨QuDye dsDNA BR 检测试剂盒
[1175. prime number arrangement]
Dynamic style binding --style and class
Huffman Tree (1) Basic Concept and C - language Implementation
Qiao NPMS: search for NPM packages
Lumiprobe蛋白质定量丨QuDye 蛋白定量试剂盒
微信小程序怎么实现圆心进度条
PHP获取Opcode及C源码
数据库 OLAP、OLTP是什么?相同和不同?适用场景
1. Introduction to generating countermeasures network
Implementation principle of PostgreSQL heap table storage engine
SQL必需掌握的100个重要知识点:创建和操纵表
AVL平衡二叉树(一) - 概念与C语言实现
毕业设计
阿里kube-eventer mysql sink简单使用记录
判断js对象是否为空的方式