This commit is contained in:
duanxiaohai 2024-04-15 16:56:36 +08:00
parent ab14664f4e
commit ff5483980b
4 changed files with 222 additions and 65 deletions

View File

@ -25,15 +25,15 @@ const color = [
colorStops: [ colorStops: [
{ {
offset: 0, offset: 0,
color: "#40BDF7", color: "rgba(142, 187, 255, 1)",
}, },
{ {
offset: 0.5, offset: 0.5,
color: "#40BDF7", color: "rgba(142, 187, 255, 0.5)",
}, },
{ {
offset: 1, offset: 1,
color: "#3F82F7", color: "rgba(142, 187, 255, 0.20)",
}, },
], ],
}, },
@ -51,11 +51,16 @@ const option = {
}, },
legend: { legend: {
data: ["计划生育人数", "计划生育补贴金额"], data: ["计划生育人数", "计划生育补贴金额"],
top: "8%",
textStyle: {
fontSize: 12,
color: "#ccc",
},
}, },
grid: { grid: {
left: "3%", left: "3%",
right: "4%", right: "6%",
bottom: "3%", bottom: "0%",
containLabel: true, containLabel: true,
color: "#ffffff", color: "#ffffff",
}, },
@ -66,6 +71,12 @@ const option = {
{ {
type: "category", type: "category",
// name: "/", // name: "/",
axisLabel: {
//
textStyle: {
color: "#ccc",
},
},
data: ["2019", "2020", "2021", "2022", "2023"], data: ["2019", "2020", "2021", "2022", "2023"],
}, },
@ -88,6 +99,12 @@ const option = {
width: 1, width: 1,
}, },
}, },
axisLabel: {
//
textStyle: {
color: "#ccc",
},
},
}, },
{ {
type: "value", type: "value",
@ -102,6 +119,12 @@ const option = {
width: 1, width: 1,
}, },
}, },
axisLabel: {
//
textStyle: {
color: "#ccc",
},
},
// max: 300, // max: 300,
// position: "right", // position: "right",
// boundaryGap: [0.2, 0.2] // boundaryGap: [0.2, 0.2]
@ -125,7 +148,7 @@ const option = {
color: "rgba(180, 180, 180, 0.2)", // color: "rgba(180, 180, 180, 0.2)", //
}, },
data: data.map(() => max), data: data.map(() => max),
barWidth: 60, // barWidth: 40, //
emphasis: { emphasis: {
itemStyle: { itemStyle: {
color: { color: {

View File

@ -9,34 +9,81 @@ import * as echarts from "echarts";
const chart = ref(); // DOM const chart = ref(); // DOM
let option = { const data = [120, 200, 150, 80, 70, 110, 130];
const lineData = [150, 230, 224, 218, 135, 147, 260];
const max = data
.concat(lineData)
.reduce((pre, cur) => (pre > cur ? pre : cur), 0); //
//
const color = [
{
type: "linear",
x: 0,
x2: 0,
y: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(142, 187, 255, 1)",
},
{
offset: 0.5,
color: "rgba(142, 187, 255, 0.5)",
},
{
offset: 1,
color: "rgba(142, 187, 255, 0.20)",
},
],
},
];
const option = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}",
axisPointer: { axisPointer: {
type: "cross", type: "cross",
label: { label: {
backgroundColor: "#ff0000", // backgroundColor: "#3F82F7", //
}, },
}, },
}, },
legend: { legend: {
data: ["上门服务时长", "上门服务次数"], data: ["上门服务时长", "上门服务次数"],
top: "8%",
textStyle: {
fontSize: 12,
color: "#ccc",
},
}, },
grid: { grid: {
left: "3%", left: "3%",
right: "4%", right: "6%",
bottom: "3%", bottom: "0%",
containLabel: true, containLabel: true,
color: "#ffffff", color: "#ffffff",
}, },
calculable: true, calculable: true,
color: "rgba(0, 252, 255, 1)", // color: "rgba(0, 252, 255, 1)",
color,
xAxis: [ xAxis: [
{ {
// type: "category", type: "category",
// scale: true, // name: "/",
// name: "", axisLabel: {
data: ["4-07", "4-08", "4-09", "4-10", "4-11"], //
textStyle: {
color: "#ccc",
},
},
data: ["4.07", "4.08", "4.09", "4.10", "4.11"],
},
{
type: "category",
show: false,
data: ["4.07", "4.08", "4.09", "4.10", "4.11"],
}, },
], ],
yAxis: [ yAxis: [
@ -44,55 +91,86 @@ let option = {
type: "value", type: "value",
scale: true, scale: true,
name: "上门服务时长", name: "上门服务时长",
color: "rgba(255, 252, 0, 1)", max: max,
splitLine: {
show: false,
lineStyle: {
color: "rgba(226, 226, 226, 0.3)",
width: 1,
},
},
axisLabel: {
//
textStyle: {
color: "#ccc",
},
},
}, },
{ {
type: "value", type: "value",
scale: true, scale: true,
name: "上门服务次数", name: "上门服务次数",
position: "right",
max: 1200,
min: 0, min: 0,
boundaryGap: [0.2, 0.2] max: max,
// alignTicks: true, splitLine: {
// offset: 80, show: false,
// axisLine: { lineStyle: {
// show: true, color: "rgba(226, 226, 226, 0.3)",
// lineStyle: { width: 1,
// color: colors[1] },
// } },
// }, axisLabel: {
// axisLabel: { //
// formatter: '{value} ml' textStyle: {
// } color: "#ccc",
},
},
// max: 300,
// position: "right",
// boundaryGap: [0.2, 0.2]
}, },
], ],
series: [ series: [
{ {
name: "上门服务时长", name: "上门服务时长",
data: data,
barWidth: 20,
type: "bar", type: "bar",
data: [2.0, 4.9, 7.0, 23.2, 25.6],
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "#83bff6" },
{ offset: 0.5, color: "#188df0" },
{ offset: 1, color: "#188df0" },
]),
}, //
}, },
{ {
name: "上门服务次数", name: "上门服务次数",
data: lineData,
type: "line", //线 type: "line", //线
data: [2.6, 5.9, 9.0, 16.4, 28.7], },
{
showBackground: true, xAxisIndex: 1,
backgroundStyle: { itemStyle: {
color: "rgba(180, 180, 180, 0.2)", color: "rgba(180, 180, 180, 0.2)", //
}, },
data: data.map(() => max),
barWidth: 40, //
emphasis: {
itemStyle: {
color: {
type: "linear",
x: 0,
x2: 0,
y: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "rgba(64, 247, 176, 0.25)",
},
{
offset: 1,
color: "rgba(17, 34, 64, 0.25)",
},
],
},
},
},
type: "bar",
}, },
], ],
}; };

View File

@ -1,5 +1,5 @@
<template> <template>
<div ref="chart" style="width: 100%; height: 180px"></div> <div ref="chart" style="width: 100%; height: 150px"></div>
</template> </template>
<script setup> <script setup>
@ -9,6 +9,26 @@ import * as echarts from "echarts";
const chart = ref(null); // DOM const chart = ref(null); // DOM
const data = [
"大街乡",
"社阳乡",
"沐尘畲族乡",
"庙下乡",
"溪口镇",
"罗家乡",
"罗家乡",
"罗家乡",
"罗家乡",
"罗家乡",
"罗家乡",
];
let zoomShow = false;
if (data.length > 7) {
zoomShow = true;
} else {
zoomShow = false;
}
let option = { let option = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
@ -16,40 +36,76 @@ let option = {
type: "shadow", type: "shadow",
}, },
}, },
legend: { legend: {},
},
grid: { grid: {
top: "-2%",
left: "3%", left: "3%",
right: "4%", right: "4%",
bottom: "3%", bottom: "3%",
containLabel: true, containLabel: true,
color: "#ffffff", color: "#ffffff",
}, },
dataZoom: [
{
show: zoomShow,
type: "inside",
startValue: 0,
endValue: 2,
minValueSpan: 2,
maxValueSpan: 2,
yAxisIndex: [0],
zoomOnMouseWheel: false, //
moveOnMouseWheel: true, //
moveOnMouseMove: true, //
},
{
show: zoomShow,
type: "slider",
realtime: true,
startValue: 0,
endValue: 2,
width: "3.5",
height: "80%",
yAxisIndex: [0], // y
fillerColor: "rgba(154, 181, 215, 1)", //
borderColor: "rgba(17, 100, 210, 0.12)",
backgroundColor: "#cfcfcf", //
handleSize: 0, //
showDataShadow: false, // auto
showDetail: false, //
top: "1%",
right: "5",
},
],
calculable: true, calculable: true,
color: "rgba(0, 252, 255, 1)", color: "rgba(0, 252, 255, 1)",
xAxis: {}, xAxis: {},
yAxis: { yAxis: {
type: "category", type: "category",
data: ["大街乡", "社阳乡", "沐尘畲族乡", "庙下乡", "溪口镇", "罗家乡"], data: data,
}, },
series: [ series: [
{ {
// name: "",
type: "bar", type: "bar",
data: [2, 4, 7, 23, 25, 250], data: [2, 4, 7, 23, 25, 250],
itemStyle: { itemStyle: {
normal: { normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "rgba(26,255,217,0)" }, {
// { offset: 0.5, color: "#00B7FF" }, offset: 0,
{ offset: 1, color: "#00B7FF" }, color: "rgba(5, 213, 255, 1)", // 0%
},
{
offset: 0.98,
color: "rgba(5, 213, 255, 0)", // 100%
},
]), // ]), //
// borderColor: "#00B7FF", // // borderColor: "#00B7FF", //
// borderWidth: 5, // borderWidth: 5,
borderRadius: [0, 0, 50, 0], borderRadius: [0, 0, 50, 0], //
}, },
}, },
} },
], ],
}; };

View File

@ -114,7 +114,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="displayFlex"> <div class="displayFlex center_bg">
<div class="flex2"> <div class="flex2">
<div class="yd_title mechanism"> <div class="yd_title mechanism">
<!-- <span class="text">养老机构</span> --> <!-- <span class="text">养老机构</span> -->
@ -151,7 +151,7 @@
<div class="serviceTop"> <div class="serviceTop">
<div class="visit"> <div class="visit">
<img class="serviceimg" src="@/assets/YLimg/ylimg8.png" alt="" /> <img class="serviceimg" src="@/assets/YLimg/ylimg8.png" alt="" />
<div style="width: 290px;height: 220px"> <div style="width: 340px;height: 220px">
<ylSMFW></ylSMFW> <ylSMFW></ylSMFW>
</div> </div>
</div> </div>
@ -169,7 +169,7 @@
src="@/assets/YLimg/ylimg7.png" src="@/assets/YLimg/ylimg7.png"
alt="" alt=""
/> />
<div style="width: 490px;height: 220px"> <div style="width: 490px;height: 150px">
<ylXZZC></ylXZZC> <ylXZZC></ylXZZC>
</div> </div>
</div> </div>
@ -283,7 +283,7 @@ const change = (name, index) => {
.serviceTop { .serviceTop {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 20px 20px 0px 20px ; padding: 10px 36px 0px 20px ;
box-sizing: border-box; box-sizing: border-box;
.visit { .visit {
display: flex; display: flex;
@ -296,8 +296,8 @@ const change = (name, index) => {
align-items: center; align-items: center;
.ylimg { .ylimg {
width: 205px; width: 200px;
height: 239px; height: 220px;
} }
.medicalServiceTop { .medicalServiceTop {
@ -305,10 +305,10 @@ const change = (name, index) => {
span { span {
position: absolute; position: absolute;
left: 38px; left: 39px;
top: 35%; top: 35%;
font-weight: bold; font-weight: bold;
font-size: 36px; font-size: 32px;
color: #ffffff; color: #ffffff;
line-height: 41px; line-height: 41px;
letter-spacing: 1px; letter-spacing: 1px;