This commit is contained in:
姚宇浩 2024-05-23 11:05:35 +08:00
parent 5519b60e79
commit abbb6c1012
8 changed files with 527 additions and 309 deletions

View File

@ -84,6 +84,9 @@ const getOption = () => {
{ {
name: "在册数", name: "在册数",
type: "value", type: "value",
nameTextStyle: { // Y
fontSize: 14 // 20
},
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {

View File

@ -66,6 +66,9 @@ data.option = {
{ {
name: "历年体检人数", name: "历年体检人数",
type: "value", type: "value",
nameTextStyle: { // Y
fontSize: 14 // 20
},
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%;height:250px;"></div> <div ref="chart" style="width: 100%; height: 260px"></div>
</template> </template>
<script setup > <script setup >
@ -36,7 +36,7 @@ const data = reactive({
year: [], year: [],
option: {}, option: {},
bg: [], bg: [],
}) });
const getOption = () => { const getOption = () => {
data.option = { data.option = {
@ -47,14 +47,15 @@ const getOption = () => {
}, },
legend: { legend: {
data: ["90-98补贴人次", "99以上补贴人次"], data: ["90-98补贴人次", "99以上补贴人次"],
top: "8%", top: "5%",
right: "15%", right: "25%",
textStyle: { textStyle: {
fontSize: 16, fontSize: 16,
color: "#ffffff", color: "#ffffff",
}, },
}, },
grid: { grid: {
top:'25%',
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "3%", bottom: "3%",
@ -72,8 +73,10 @@ const getOption = () => {
}, },
}, },
}, },
yAxis: { yAxis: [
{
type: "value", type: "value",
name: "90-98补贴人次",
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -82,6 +85,10 @@ const getOption = () => {
width: 1, width: 1,
}, },
}, },
nameTextStyle: {
// Y
fontSize: 14, // 20
},
axisLabel: { axisLabel: {
// //
textStyle: { textStyle: {
@ -89,7 +96,52 @@ const getOption = () => {
fontSize: 16, fontSize: 16,
}, },
}, },
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
}, },
},
},
{
type: "value",
name: "99以上补贴人次",
splitLine: {
show: false,
lineStyle: {
color: "rgba(255, 255, 255, 0.2)",
fontSize: 16,
width: 1,
},
},
nameTextStyle: {
// Y
fontSize: 14, // 20
},
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
},
},
},
],
series: [ series: [
{ {
name: "背景", name: "背景",
@ -101,10 +153,10 @@ const getOption = () => {
}, },
}, },
{ {
yAxisIndex: 0,
name: "90-98补贴人次", name: "90-98补贴人次",
type: "line", type: "line",
symbol: "emptyCircle", symbol: "emptyCircle",
symbolSize: 10, symbolSize: 10,
itemStyle: { itemStyle: {
borderColor: "#E8FF00", borderColor: "#E8FF00",
@ -115,6 +167,7 @@ const getOption = () => {
data: data.list1, data: data.list1,
}, },
{ {
yAxisIndex: 1,
name: "99以上补贴人次", name: "99以上补贴人次",
type: "line", type: "line",
symbol: "emptyCircle", symbol: "emptyCircle",
@ -130,7 +183,7 @@ const getOption = () => {
}, },
], ],
}; };
} };
const setChart = () => { const setChart = () => {
// Vue3 // Vue3
@ -138,21 +191,21 @@ const setChart = () => {
// 使 // 使
myChart.setOption(data.option); myChart.setOption(data.option);
} };
// 使 // 使
// 使 // 使
onBeforeMount(() => { onBeforeMount(() => {
setTimeout(() => { setTimeout(() => {
data.list1 = props.list1 data.list1 = props.list1;
data.list2 = props.list2 data.list2 = props.list2;
data.year = props.year data.year = props.year;
data.year.forEach(() => { data.year.forEach(() => {
data.bg.push(0) data.bg.push(0);
}) });
getOption() getOption();
setChart() setChart();
}, 600) }, 600);
}); });
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%;height:250px;"></div> <div ref="chart" style="width: 100%; height: 260px"></div>
</template> </template>
<script setup> <script setup>
@ -36,7 +36,7 @@ const data = reactive({
year: [], year: [],
option: {}, option: {},
bg: [], bg: [],
}) });
const getOption = () => { const getOption = () => {
data.option = { data.option = {
@ -47,17 +47,18 @@ const getOption = () => {
}, },
legend: { legend: {
data: ["90-98补贴金额", "99以上补贴金额"], data: ["90-98补贴金额", "99以上补贴金额"],
top: "8%", top: "3%",
right: "15%", right: "25%",
textStyle: { textStyle: {
fontSize: 16, fontSize: 16,
color: "#ffffff", color: "#ffffff",
}, },
}, },
grid: { grid: {
top:'25%',
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "3%", bottom: "0%",
containLabel: true, containLabel: true,
}, },
@ -81,8 +82,14 @@ const getOption = () => {
}, },
}, },
}, },
yAxis: { yAxis: [
{
name: "90-98补贴金额",
type: "value", type: "value",
nameTextStyle: {
// Y
fontSize: 14, // 20
},
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -97,7 +104,50 @@ const getOption = () => {
fontSize: 16, fontSize: 16,
}, },
}, },
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
}, },
},
},
{
name: "99以上补贴金额",
type: "value",
nameTextStyle: {
// Y
fontSize: 14, // 20
},
splitLine: {
show: false,
lineStyle: {
color: "rgba(226, 226, 226, 0.3)",
width: 1,
},
},
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
},
},
},
],
series: [ series: [
{ {
name: "背景", name: "背景",
@ -110,6 +160,7 @@ const getOption = () => {
}, },
}, },
{ {
yAxisIndex: 0,
name: "90-98补贴金额", name: "90-98补贴金额",
type: "line", type: "line",
symbol: "emptyCircle", symbol: "emptyCircle",
@ -124,6 +175,7 @@ const getOption = () => {
data: data.list1, data: data.list1,
}, },
{ {
yAxisIndex: 1,
name: "99以上补贴金额", name: "99以上补贴金额",
type: "line", type: "line",
stack: "Total", stack: "Total",
@ -140,7 +192,7 @@ const getOption = () => {
}, },
], ],
}; };
} };
const setChart = () => { const setChart = () => {
// Vue3 // Vue3
@ -148,21 +200,21 @@ const setChart = () => {
// 使 // 使
myChart.setOption(data.option); myChart.setOption(data.option);
} };
// 使 // 使
// 使 // 使
onBeforeMount(() => { onBeforeMount(() => {
setTimeout(() => { setTimeout(() => {
data.list1 = props.list1 data.list1 = props.list1;
data.list2 = props.list2 data.list2 = props.list2;
data.year = props.year data.year = props.year;
data.year.forEach(() => { data.year.forEach(() => {
data.bg.push(0) data.bg.push(0);
}) });
getOption() getOption();
setChart() setChart();
}, 600) }, 600);
}); });
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%;height:280px;"></div> <div ref="chart" style="width: 100%; height: 285px"></div>
</template> </template>
<script setup > <script setup >
@ -36,7 +36,7 @@ const data = reactive({
year: [], year: [],
option: {}, option: {},
bg: [], bg: [],
}) });
const getOption = () => { const getOption = () => {
data.option = { data.option = {
@ -47,14 +47,15 @@ const getOption = () =>{
}, },
legend: { legend: {
data: ["特困发放人次", "低保发放人次"], data: ["特困发放人次", "低保发放人次"],
top: "8%", top: "5%",
right: "11%", right: "28%",
textStyle: { textStyle: {
fontSize: 16, fontSize: 16,
color: "#ffffff", color: "#ffffff",
}, },
}, },
grid: { grid: {
top:'25%',
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "3%", bottom: "3%",
@ -73,8 +74,14 @@ const getOption = () =>{
}, },
}, },
}, },
yAxis: { yAxis: [
{
name: "特困发放人次",
type: "value", type: "value",
nameTextStyle: {
// Y
fontSize: 14, // 20
},
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -90,7 +97,51 @@ const getOption = () =>{
fontSize: 16, fontSize: 16,
}, },
}, },
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
}, },
},
},
{
name: "低保发放人次",
type: "value",
nameTextStyle: {
// Y
fontSize: 14, // 20
},
splitLine: {
show: false,
lineStyle: {
color: "rgba(255, 255, 255, 0.2)",
fontSize: 16,
width: 1,
},
},
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
},
},
},
],
series: [ series: [
{ {
name: "背景", name: "背景",
@ -102,6 +153,7 @@ const getOption = () =>{
}, },
}, },
{ {
yAxisIndex: 0,
name: "特困发放人次", name: "特困发放人次",
type: "line", type: "line",
symbol: "emptyCircle", symbol: "emptyCircle",
@ -115,6 +167,7 @@ const getOption = () =>{
data: data.list1, data: data.list1,
}, },
{ {
yAxisIndex: 1,
name: "低保发放人次", name: "低保发放人次",
type: "line", type: "line",
symbol: "emptyCircle", symbol: "emptyCircle",
@ -129,27 +182,27 @@ const getOption = () =>{
}, },
], ],
}; };
} };
const setChart = () => { const setChart = () => {
// Vue3 // Vue3
var myChart = echarts.init(chart.value); var myChart = echarts.init(chart.value);
// 使 // 使
myChart.setOption(data.option); myChart.setOption(data.option);
} };
// 使 // 使
onBeforeMount(() => { onBeforeMount(() => {
setTimeout(() => { setTimeout(() => {
data.list1 = props.list1 data.list1 = props.list1;
data.list2 = props.list2 data.list2 = props.list2;
data.year = props.year data.year = props.year;
data.year.forEach(() => { data.year.forEach(() => {
data.bg.push(0) data.bg.push(0);
}) });
getOption() getOption();
setChart() setChart();
}, 600) }, 600);
}); });
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%;height:280px;"></div> <div ref="chart" style="width: 100%;height:285px;"></div>
</template> </template>
<script setup > <script setup >
@ -52,6 +52,7 @@ const getOption = () =>{
}, },
}, },
grid: { grid: {
top:'25%',
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "5%", bottom: "5%",

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%; height:250px;"></div> <div ref="chart" style="width: 100%; height:260px;"></div>
</template> </template>
<script setup> <script setup>

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%; height:250px;"></div> <div ref="chart" style="width: 100%; height: 260px"></div>
</template> </template>
<script setup > <script setup >
@ -35,7 +35,7 @@ const data = reactive({
year: [], year: [],
option: {}, option: {},
bg: [], bg: [],
}) });
const getOption = () => { const getOption = () => {
data.option = { data.option = {
tooltip: { tooltip: {
@ -45,17 +45,18 @@ const getOption = () => {
}, },
legend: { legend: {
data: ["职工养老保险金额", "城乡养老保险金额"], data: ["职工养老保险金额", "城乡养老保险金额"],
top: "8%", top: "3%",
right: "11%", right: "25%",
textStyle: { textStyle: {
fontSize: 16, fontSize: 16,
color: "#ffffff", color: "#ffffff",
}, },
}, },
grid: { grid: {
top:'25%',
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "3%", bottom: "0%",
containLabel: true, containLabel: true,
}, },
@ -71,8 +72,14 @@ const getOption = () => {
}, },
}, },
}, },
yAxis: { yAxis: [
{
name: "职工养老保险金额",
type: "value", type: "value",
nameTextStyle: {
// Y
fontSize: 14, // 20
},
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -88,7 +95,51 @@ const getOption = () => {
fontSize: 16, fontSize: 16,
}, },
}, },
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
}, },
},
},
{
name: "城乡养老保险金额",
type: "value",
nameTextStyle: {
// Y
fontSize: 14, // 20
},
splitLine: {
show: false,
lineStyle: {
color: "rgba(255, 255, 255, 0.2)",
fontSize: 16,
width: 1,
},
},
axisLabel: {
//
textStyle: {
color: "#ffffff",
fontSize: 16,
},
},
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
},
},
},
],
series: [ series: [
{ {
name: "背景", name: "背景",
@ -100,6 +151,7 @@ const getOption = () => {
}, },
}, },
{ {
yAxisIndex: 0,
name: "职工养老保险金额", name: "职工养老保险金额",
type: "line", type: "line",
symbol: "emptyCircle", symbol: "emptyCircle",
@ -113,6 +165,7 @@ const getOption = () => {
data: data.list1, data: data.list1,
}, },
{ {
yAxisIndex: 1,
name: "城乡养老保险金额", name: "城乡养老保险金额",
type: "line", type: "line",
symbol: "emptyCircle", symbol: "emptyCircle",
@ -128,27 +181,27 @@ const getOption = () => {
}, },
], ],
}; };
} };
const setChart = () => { const setChart = () => {
// Vue3 // Vue3
var myChart = echarts.init(chart.value); var myChart = echarts.init(chart.value);
// 使 // 使
myChart.setOption(data.option); myChart.setOption(data.option);
} };
// 使 // 使
onBeforeMount(() => { onBeforeMount(() => {
setTimeout(() => { setTimeout(() => {
data.list1 = props.list1 data.list1 = props.list1;
data.list2 = props.list2 data.list2 = props.list2;
data.year = props.year data.year = props.year;
data.year.forEach(() => { data.year.forEach(() => {
data.bg.push(0) data.bg.push(0);
}) });
getOption() getOption();
setChart() setChart();
}, 600) }, 600);
}); });
</script> </script>