This commit is contained in:
姚宇浩 2024-05-23 16:39:28 +08:00
parent 5847a42d52
commit 592c5105e8
11 changed files with 400 additions and 174 deletions

View File

@ -127,6 +127,14 @@ data.option = {
type: "bar", type: "bar",
data: data.list, data: data.list,
barWidth: 20, barWidth: 20,
label: {
show: true,
color: "#ffffff",
position:'top',
formatter: function (data) {
return data.value;
},
},
itemStyle: { itemStyle: {
normal: { normal: {
color: function (params) { color: function (params) {

View File

@ -94,6 +94,14 @@ const getOption = () => {
symbol: "emptyCircle", symbol: "emptyCircle",
symbolSize: 10, symbolSize: 10,
label: {
show: true,
color: "#ffffff",
position:'top',
formatter: function (data) {
return data.value;
},
},
itemStyle: { itemStyle: {
borderColor: "#00FCFF", borderColor: "#00FCFF",
borderWidth: 1, borderWidth: 1,

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 >
@ -122,6 +122,14 @@ const getOption = () => {
type: "bar", type: "bar",
data: data.zgffrc, data: data.zgffrc,
barWidth: "18%", barWidth: "18%",
label: {
show: true,
color: "#ffffff",
position:'top',
formatter: function (data) {
return data.value;
},
},
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {
@ -140,6 +148,14 @@ const getOption = () => {
type: "bar", type: "bar",
data: data.cxffrc, data: data.cxffrc,
barWidth: "18%", barWidth: "18%",
label: {
show: true,
color: "#ffffff",
position:'top',
formatter: function (data) {
return data.value;
},
},
itemStyle: { itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {

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,18 +35,18 @@ const getOption = () => {
}, },
legend: { legend: {
data: ["职工医疗保险金额", "城乡医疗保险金额"], data: ["职工医疗保险金额", "城乡医疗保险金额"],
top: "6%", top: "3%",
right: "11%", right: "25%",
textStyle: { textStyle: {
fontSize: 16, fontSize: 16,
color: "#ffffff", color: "#ffffff",
}, },
}, },
grid: { grid: {
top: "23%", top: "25%",
left: "1%", left: "1%",
right: "10%", right: "5%",
bottom: "3%", bottom: "0%",
containLabel: true, containLabel: true,
}, },
@ -62,8 +62,14 @@ const getOption = () => {
}, },
}, },
}, },
yAxis: { yAxis: [
{
name: "职工医疗保险金额",
type: "value", type: "value",
nameTextStyle: {
// Y
fontSize: 14, // 20
},
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
@ -78,7 +84,55 @@ const getOption = () => {
color: "#ffffff", color: "#ffffff",
}, },
}, },
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
}, },
},
},
{
name: "城乡医疗保险金额",
type: "value",
min: 0, // Y
max: function (value) {
// Y
return Math.ceil(Math.max(value.max, value.max * 1.5) / 50) * 50;
},
splitLine: {
show: false,
lineStyle: {
color: "rgba(226, 226, 226, 0.3)",
width: 1,
},
},
nameTextStyle: {
// Y
fontSize: 14, // 20
},
axisLabel: {
//
textStyle: {
fontSize: 16,
color: "#ffffff",
},
},
axisLine: {
//y线
show: false,
lineStyle: {
color: "#ffffff",
fontSize: 16,
width: 1,
type: "solid",
},
},
},
],
series: [ series: [
{ {
name: "背景", name: "背景",
@ -90,6 +144,7 @@ const getOption = () => {
}, },
}, },
{ {
yAxisIndex: 0,
name: "职工医疗保险金额", name: "职工医疗保险金额",
type: "line", type: "line",
symbol: "emptyCircle", symbol: "emptyCircle",
@ -100,9 +155,18 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#00FCFF", color: "#00FCFF",
}, },
label: {
show: true,
color: "#ffffff",
position: "top",
formatter: function (data) {
return data.value;
},
},
data: data.zgffje, data: data.zgffje,
}, },
{ {
yAxisIndex: 1,
name: "城乡医疗保险金额", name: "城乡医疗保险金额",
type: "line", type: "line",
symbol: "emptyCircle", symbol: "emptyCircle",
@ -113,7 +177,14 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#2468FF", color: "#2468FF",
}, },
label: {
show: true,
color: "#ffffff",
position: "bottom",
formatter: function (data) {
return data.value;
},
},
data: data.cxffje, data: data.cxffje,
}, },
], ],

View File

@ -99,7 +99,14 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#E8FF00", color: "#E8FF00",
}, },
label: {
show: true,
color: "#ffffff",
position:'top',
formatter: function (data) {
return data.value;
},
},
areaStyle: { areaStyle: {
color: "#F4F65B", color: "#F4F65B",
normal: { normal: {

View File

@ -55,7 +55,7 @@ const getOption = () => {
}, },
}, },
grid: { grid: {
top:'25%', top: "25%",
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "3%", bottom: "3%",
@ -85,6 +85,11 @@ const getOption = () => {
width: 1, width: 1,
}, },
}, },
min: 0, // Y
max: function (value) {
// Y
return Math.ceil(Math.max(value.max, value.max * 1.2) / 50) * 50;
},
nameTextStyle: { nameTextStyle: {
// Y // Y
fontSize: 14, // 20 fontSize: 14, // 20
@ -117,6 +122,11 @@ const getOption = () => {
fontSize: 16, fontSize: 16,
width: 1, width: 1,
}, },
},
min: 0, // Y
max: function (value) {
// Y
return Math.ceil(Math.max(value.max, value.max * 1.6) / 50) * 50;
}, },
nameTextStyle: { nameTextStyle: {
// Y // Y
@ -163,6 +173,13 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#E8FF00", color: "#E8FF00",
}, },
label: {
show: true,
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
data: data.list1, data: data.list1,
}, },
@ -178,7 +195,13 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#2468FF", color: "#2468FF",
}, },
label: {
show: true,
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
data: data.list2, data: data.list2,
}, },
], ],

View File

@ -55,7 +55,7 @@ const getOption = () => {
}, },
}, },
grid: { grid: {
top:'25%', top: "25%",
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "0%", bottom: "0%",
@ -118,6 +118,11 @@ const getOption = () => {
{ {
name: "99以上补贴金额", name: "99以上补贴金额",
type: "value", type: "value",
min: 0, // Y
max: function (value) {
// Y
return Math.ceil(Math.max(value.max, value.max * 1.5) / 50) * 50;
},
nameTextStyle: { nameTextStyle: {
// Y // Y
fontSize: 14, // 20 fontSize: 14, // 20
@ -171,7 +176,14 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#E8FF00", color: "#E8FF00",
}, },
label: {
show: true,
color: "#ffffff",
position: "top",
formatter: function (data) {
return data.value;
},
},
data: data.list1, data: data.list1,
}, },
{ {
@ -187,7 +199,14 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#2468FF", color: "#2468FF",
}, },
label: {
show: true,
color: "#ffffff",
position: "bottom",
formatter: function (data) {
return data.value;
},
},
data: data.list2, data: data.list2,
}, },
], ],

View File

@ -55,7 +55,7 @@ const getOption = () => {
}, },
}, },
grid: { grid: {
top:'25%', top: "25%",
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "3%", bottom: "3%",
@ -78,6 +78,11 @@ const getOption = () => {
{ {
name: "特困发放人次", name: "特困发放人次",
type: "value", type: "value",
min: 0, // Y
max: function (value) {
// Y
return Math.ceil(Math.max(value.max, value.max * 2) / 50) * 50;
},
nameTextStyle: { nameTextStyle: {
// Y // Y
fontSize: 14, // 20 fontSize: 14, // 20
@ -111,6 +116,11 @@ const getOption = () => {
{ {
name: "低保发放人次", name: "低保发放人次",
type: "value", type: "value",
min: 0, // Y
max: function (value) {
// Y
return Math.ceil(Math.max(value.max, value.max * 1.3) / 50) * 50;
},
nameTextStyle: { nameTextStyle: {
// Y // Y
fontSize: 14, // 20 fontSize: 14, // 20
@ -164,6 +174,13 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#00FCFF", color: "#00FCFF",
}, },
label: {
show: true,
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
data: data.list1, data: data.list1,
}, },
{ {
@ -178,6 +195,13 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#2468FF", color: "#2468FF",
}, },
label: {
show: true,
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
data: data.list2, data: data.list2,
}, },
], ],

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%;height:285px;"></div> <div ref="chart" style="width: 100%; height: 285px"></div>
</template> </template>
<script setup > <script setup >
@ -34,8 +34,8 @@ const data = reactive({
list1: [], list1: [],
list2: [], list2: [],
year: [], year: [],
option: {} option: {},
}) });
const getOption = () => { const getOption = () => {
data.option = { data.option = {
@ -52,7 +52,7 @@ const getOption = () =>{
}, },
}, },
grid: { grid: {
top:'25%', top: "25%",
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "5%", bottom: "5%",
@ -81,7 +81,6 @@ const getOption = () =>{
fontSize: 16, fontSize: 16,
}, },
}, },
], ],
yAxis: [ yAxis: [
@ -110,7 +109,7 @@ const getOption = () =>{
show: false, show: false,
lineStyle: { lineStyle: {
type: "solid", type: "solid",
color: "rgb(221, 242, 255,0.3)" color: "rgb(221, 242, 255,0.3)",
}, },
}, },
axisLine: { axisLine: {
@ -127,7 +126,6 @@ const getOption = () =>{
lineHeight: 19, lineHeight: 19,
}, },
}, },
], ],
series: [ series: [
{ {
@ -147,6 +145,14 @@ const getOption = () =>{
}, },
]), ]),
}, },
label: {
show: true,
color: "#ffffff",
position: "top",
formatter: function (data) {
return data.value;
},
},
}, },
{ {
name: "低保补助金额", name: "低保补助金额",
@ -165,6 +171,14 @@ const getOption = () =>{
}, },
]), ]),
}, },
label: {
show: true,
color: "#ffffff",
position: "top",
formatter: function (data) {
return data.value;
},
},
}, },
{ {
type: "bar", type: "bar",
@ -178,24 +192,24 @@ 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;
getOption() getOption();
setChart() setChart();
}, 600) }, 600);
}); });
</script> </script>

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%; height:260px;"></div> <div ref="chart" style="width: 100%; height: 260px"></div>
</template> </template>
<script setup> <script setup>
@ -34,8 +34,8 @@ const data = reactive({
list1: [], list1: [],
list2: [], list2: [],
year: [], year: [],
option: {} option: {},
}) });
const getOption = () => { const getOption = () => {
data.option = { data.option = {
tooltip: { tooltip: {
@ -139,6 +139,14 @@ const getOption = () => {
}, },
]), ]),
}, },
label: {
show: true,
position:'top',
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
}, },
{ {
name: "城乡养老保险发放人次", name: "城乡养老保险发放人次",
@ -157,6 +165,14 @@ const getOption = () => {
}, },
]), ]),
}, },
label: {
show: true,
position:'top',
color: "#ffffff",
formatter: function (data) {
return data.value;
},
},
}, },
{ {
type: "bar", type: "bar",
@ -170,24 +186,24 @@ 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;
getOption() getOption();
setChart() setChart();
}, 600) }, 600);
}); });
</script> </script>

View File

@ -53,7 +53,7 @@ const getOption = () => {
}, },
}, },
grid: { grid: {
top:'25%', top: "25%",
left: "1%", left: "1%",
right: "10%", right: "10%",
bottom: "0%", bottom: "0%",
@ -109,6 +109,11 @@ const getOption = () => {
{ {
name: "城乡养老保险金额", name: "城乡养老保险金额",
type: "value", type: "value",
min: 0, // Y
max: function (value) {
// Y
return Math.ceil(Math.max(value.max, value.max * 1.4) / 50) * 50;
},
nameTextStyle: { nameTextStyle: {
// Y // Y
fontSize: 14, // 20 fontSize: 14, // 20
@ -162,6 +167,14 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#00FCFF", color: "#00FCFF",
}, },
label: {
show: true,
color: "#ffffff",
position: "bottom",
formatter: function (data) {
return data.value;
},
},
data: data.list1, data: data.list1,
}, },
{ {
@ -176,7 +189,14 @@ const getOption = () => {
borderWidth: 1, borderWidth: 1,
color: "#2468FF", color: "#2468FF",
}, },
label: {
show: true,
color: "#ffffff",
position: "bottom",
formatter: function (data) {
return data.value;
},
},
data: data.list2, data: data.list2,
}, },
], ],