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

View File

@ -9,34 +9,81 @@ import * as echarts from "echarts";
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: {
trigger: "axis",
formatter: "{b0}<br/> {a0}:{c0}<br/>{a1}:{c1}",
axisPointer: {
type: "cross",
label: {
backgroundColor: "#ff0000", //
backgroundColor: "#3F82F7", //
},
},
},
legend: {
data: ["上门服务时长", "上门服务次数"],
top: "8%",
textStyle: {
fontSize: 12,
color: "#ccc",
},
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
right: "6%",
bottom: "0%",
containLabel: true,
color: "#ffffff",
},
calculable: true,
color: "rgba(0, 252, 255, 1)",
// color: "rgba(0, 252, 255, 1)",
color,
xAxis: [
{
// type: "category",
// scale: true,
// name: "",
data: ["4-07", "4-08", "4-09", "4-10", "4-11"],
type: "category",
// name: "/",
axisLabel: {
//
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: [
@ -44,55 +91,86 @@ let option = {
type: "value",
scale: true,
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",
scale: true,
name: "上门服务次数",
position: "right",
max: 1200,
min: 0,
boundaryGap: [0.2, 0.2]
// alignTicks: true,
// offset: 80,
// axisLine: {
// show: true,
// lineStyle: {
// color: colors[1]
// }
// },
// axisLabel: {
// formatter: '{value} ml'
// }
max: max,
splitLine: {
show: false,
lineStyle: {
color: "rgba(226, 226, 226, 0.3)",
width: 1,
},
},
axisLabel: {
//
textStyle: {
color: "#ccc",
},
},
// max: 300,
// position: "right",
// boundaryGap: [0.2, 0.2]
},
],
series: [
{
name: "上门服务时长",
data: data,
barWidth: 20,
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: "上门服务次数",
data: lineData,
type: "line", //线
data: [2.6, 5.9, 9.0, 16.4, 28.7],
showBackground: true,
backgroundStyle: {
color: "rgba(180, 180, 180, 0.2)",
},
{
xAxisIndex: 1,
itemStyle: {
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>
<div ref="chart" style="width: 100%; height: 180px"></div>
<div ref="chart" style="width: 100%; height: 150px"></div>
</template>
<script setup>
@ -9,6 +9,26 @@ import * as echarts from "echarts";
const chart = ref(null); // DOM
const data = [
"大街乡",
"社阳乡",
"沐尘畲族乡",
"庙下乡",
"溪口镇",
"罗家乡",
"罗家乡",
"罗家乡",
"罗家乡",
"罗家乡",
"罗家乡",
];
let zoomShow = false;
if (data.length > 7) {
zoomShow = true;
} else {
zoomShow = false;
}
let option = {
tooltip: {
trigger: "axis",
@ -16,40 +36,76 @@ let option = {
type: "shadow",
},
},
legend: {
},
legend: {},
grid: {
top: "-2%",
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
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,
color: "rgba(0, 252, 255, 1)",
xAxis: {},
yAxis: {
type: "category",
data: ["大街乡", "社阳乡", "沐尘畲族乡", "庙下乡", "溪口镇", "罗家乡"],
data: data,
},
series: [
{
// name: "",
type: "bar",
data: [2, 4, 7, 23, 25, 250],
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: "rgba(26,255,217,0)" },
// { offset: 0.5, color: "#00B7FF" },
{ offset: 1, color: "#00B7FF" },
{
offset: 0,
color: "rgba(5, 213, 255, 1)", // 0%
},
{
offset: 0.98,
color: "rgba(5, 213, 255, 0)", // 100%
},
]), //
// borderColor: "#00B7FF", //
// borderWidth: 5,
borderRadius: [0, 0, 50, 0],
borderRadius: [0, 0, 50, 0], //
},
},
},
}
],
};

View File

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