坐标轴

This commit is contained in:
花有清香月有阴
2021-12-22 18:27:43 +08:00
parent af67ad1055
commit 7623b6e3f1

View File

@@ -283,39 +283,39 @@ export default {
initEcharts1(data) { initEcharts1(data) {
var option = { var option = {
legend: { legend: {
borderColor: 'pink',
data: ['群成员总数', '入群人数', '退群人数'], data: ['群成员总数', '入群人数', '退群人数'],
y: 'bottom',
}, },
color: ['#4A86FD', '#32C5FF', '#FFAA44'],
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
}, },
grid: { grid: {
top: '12%', top: '9%',
left: '6%', left: '6%',
right: '8%', right: '8%',
bottom: '6%', bottom: '9%',
containLabel: true, containLabel: true,
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
data: Object.keys(data).map((e) => e.substring(e.length - 5, e.length)), data: Object.keys(data).map((e) => e.substring(e.length - 5, e.length)),
axisLine: { axisLine: {
lineStyle: { color: '#157EFF' }, show: true,
lineStyle: { color: '#666' },
}, },
axisLabel: { axisLabel: {
show: true, show: true,
interval: 0, interval: 0,
}, },
axisTick: { axisTick: {
interval: 'auto', show: false,
}, },
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
axisLine: { axisLine: {
lineStyle: { show: false,
color: '#666',
},
}, },
splitLine: { splitLine: {
show: true, show: true,
@@ -327,10 +327,13 @@ export default {
show: true, show: true,
interval: 0, interval: 0,
}, },
axisTick: {
show: false,
},
}, },
series: [ series: [
{ {
itemStyle: { lineStyle: {
normal: { normal: {
lineStyle: { lineStyle: {
color: '#4A86FD', color: '#4A86FD',
@@ -344,7 +347,7 @@ export default {
data: Object.values(data).map((e) => e.total), data: Object.values(data).map((e) => e.total),
}, },
{ {
itemStyle: { lineStyle: {
normal: { normal: {
lineStyle: { lineStyle: {
color: '#32C5FF', color: '#32C5FF',
@@ -358,7 +361,7 @@ export default {
data: Object.values(data).map((e) => e.increase), data: Object.values(data).map((e) => e.increase),
}, },
{ {
itemStyle: { lineStyle: {
normal: { normal: {
lineStyle: { lineStyle: {
color: '#FFAA44', color: '#FFAA44',
@@ -381,15 +384,17 @@ export default {
var options = { var options = {
legend: { legend: {
data: ['居民总数', '新增居民数', '流失居民数'], data: ['居民总数', '新增居民数', '流失居民数'],
y: 'bottom',
}, },
color: ['#4A86FD', '#32C5FF', '#FFAA44'],
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
}, },
grid: { grid: {
top: '12%', top: '9%',
left: '6%', left: '6%',
right: '8%', right: '8%',
bottom: '6%', bottom: '9%',
containLabel: true, containLabel: true,
}, },
xAxis: { xAxis: {
@@ -403,15 +408,13 @@ export default {
interval: 0, interval: 0,
}, },
axisTick: { axisTick: {
interval: 'auto', show: false,
}, },
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
axisLine: { axisLine: {
lineStyle: { show: false,
color: '#666',
},
}, },
splitLine: { splitLine: {
show: true, show: true,
@@ -423,10 +426,13 @@ export default {
show: true, show: true,
interval: 0, interval: 0,
}, },
axisTick: {
show: false,
},
}, },
series: [ series: [
{ {
itemStyle: { lineStyle: {
normal: { normal: {
lineStyle: { lineStyle: {
color: '#4A86FD', color: '#4A86FD',
@@ -440,7 +446,7 @@ export default {
data: Object.values(data).map((e) => e.total), data: Object.values(data).map((e) => e.total),
}, },
{ {
itemStyle: { lineStyle: {
normal: { normal: {
lineStyle: { lineStyle: {
color: '#32C5FF', color: '#32C5FF',
@@ -454,7 +460,7 @@ export default {
data: Object.values(data).map((e) => e.increase), data: Object.values(data).map((e) => e.increase),
}, },
{ {
itemStyle: { lineStyle: {
normal: { normal: {
lineStyle: { lineStyle: {
color: '#FFAA44', color: '#FFAA44',
@@ -605,7 +611,7 @@ uni-page-body {
.echartes { .echartes {
margin-top: 64px; margin-top: 64px;
padding-top: 20px; padding-bottom: 20px;
height: 616px; height: 616px;
background: #fff; background: #fff;
box-sizing: border-box; box-sizing: border-box;