From 9208afcea6521e3ba16b21e4d3c83bce228b62c2 Mon Sep 17 00:00:00 2001 From: yaoyuhao Date: Tue, 4 Jun 2024 13:39:15 +0800 Subject: [PATCH] gx --- src/view/echarts_hygiene/eP5.vue | 203 ++++++++------ src/view/echarts_hygiene/eP7.vue | 437 +++++++++++++++++++------------ src/view/echarts_hygiene/pie.vue | 4 +- src/view/echarts_yl/ylJHSY.vue | 63 +++-- src/view/echarts_yl/ylSMFW.vue | 75 ++++-- src/view/sy.vue | 18 +- 6 files changed, 507 insertions(+), 293 deletions(-) diff --git a/src/view/echarts_hygiene/eP5.vue b/src/view/echarts_hygiene/eP5.vue index 6676019..a809692 100644 --- a/src/view/echarts_hygiene/eP5.vue +++ b/src/view/echarts_hygiene/eP5.vue @@ -44,32 +44,6 @@ const getOption = () => { { type: "category", axisLabel: { - // formatter: function (params) { - // var str = ""; // 最终拼接成的字符串 - // var paramsLen = params.length; // 获取每项文字的个数 - // var len = 6; // 每行能显示的字的个数(根据实际情况自己设置) - // var rowNumber = Math.ceil(paramsLen / len); // 换行的话,需要显示几行,向上取整 - // if (paramsLen > len) { - // //大于设定的len就换行,不大于就不变化 - // for (var i = 0; i < rowNumber; i++) { - // var temp = ""; // 表示每一次截取的字符串 - // var start = i * len; // 开始截取的位置 - // var end = start + len; // 结束截取的位置 - // if (i == rowNumber - 1) { - // // 最后一次不换行 - // temp = params.substring(start, paramsLen); - // } else { - // // 每一次拼接字符串并换行 - // temp = params.substring(start, end) + "\n"; - // } - // str += temp; // 最终拼成的字符串 - // } - // } else { - // // 给新的字符串赋值 - // str = params; - // } - // return str; //返回字符串 - // }, textStyle: { color: "#ffffff", fontSize: 15, @@ -116,6 +90,7 @@ const getOption = () => { ], series: [ { + z: 1, name: "精神病健康居家在册管理人数", type: "bar", data: data.rs, @@ -131,65 +106,143 @@ const getOption = () => { itemStyle: { normal: { color: function (params) { + // var colorList = [ + // new echarts.graphic.LinearGradient( + // 0, + // 0, + // 0, + // 1, + // [ + // { + // offset: 0, + // color: "rgba(23, 237, 255, 1)", + // }, + // { + // offset: 1, + // color: "rgba(23, 237, 255, 0.20)", + // }, + // ], + // false + // ), + // new echarts.graphic.LinearGradient( + // 0, + // 0, + // 0, + // 1, + // [ + // { + // offset: 0, + // color: "rgba(255, 243, 119, 1)", + // }, + // { + // offset: 1, + // color: "rgba(255, 242, 142, 0.20)", + // }, + // ], + // false + // ), + // new echarts.graphic.LinearGradient( + // 0, + // 0, + // 0, + // 1, + // [ + // { + // offset: 0, + // color: "rgba(142, 187, 255, 1)", + // }, + // { + // offset: 1, + // color: "rgba(142, 187, 255, 0.20)", + // }, + // ], + // false + // ), + // ]; var colorList = [ - new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "rgba(23, 237, 255, 1)", - }, - { - offset: 1, - color: "rgba(23, 237, 255, 0.20)", - }, + { + type: "linear", + x: 0, + x2: 1, + y: 0, + y2: 0, + colorStops: [ + { offset: 0, color: "rgba(23, 237, 255, .7)" }, + { offset: 0.5, color: "rgba(23, 237, 255, .7)" }, + { offset: 0.5, color: "rgba(23, 237, 255, .3)" }, + { offset: 1, color: "rgba(23, 237, 255, .5)" }, ], - false - ), - new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "rgba(255, 243, 119, 1)", - }, - { - offset: 1, - color: "rgba(255, 242, 142, 0.20)", - }, + }, + { + type: "linear", + x: 0, + x2: 1, + y: 0, + y2: 0, + colorStops: [ + { offset: 0, color: "rgba(255, 242, 142, .7)" }, + { offset: 0.5, color: "rgba(255, 242, 142, .7)" }, + { offset: 0.5, color: "rgba(255, 242, 142, .3)" }, + { offset: 1, color: "rgba(255, 242, 142, .5)" }, ], - false - ), - new echarts.graphic.LinearGradient( - 0, - 0, - 0, - 1, - [ - { - offset: 0, - color: "rgba(142, 187, 255, 1)", - }, - { - offset: 1, - color: "rgba(142, 187, 255, 0.20)", - }, + }, + { + type: "linear", + x: 0, + x2: 1, + y: 0, + y2: 0, + colorStops: [ + { offset: 0, color: "rgba(142, 187, 255, .7)" }, + { offset: 0.5, color: "rgba(142, 187, 255, .7)" }, + { offset: 0.5, color: "rgba(142, 187, 255, .3)" }, + { offset: 1, color: "rgba(142, 187, 255, .5)" }, ], - false - ), + }, ]; - return colorList[params.dataIndex % colorList.length]; }, }, }, }, + { + z: 1, + name: "上部1", + type: "pictorialBar", + symbolPosition: "end", + data: data.rs, + symbol: "diamond", + symbolOffset: ["0%", "-50%"], + symbolSize: [21, 15], + itemStyle: { + normal: { + color: function (params) { + var colorList = [ + { + offset: 1, + color: "rgba(23, 237, 255, 1)", + }, + + { + offset: 1, + color: "rgba(255, 242, 142, 1)", + }, + + { + offset: 1, + color: "rgba(142, 187, 255, 1)", + }, + ]; + + return colorList[params.dataIndex % colorList.length].color; + }, + }, + }, + // itemStyle: { + // borderColor: "#2fffa4", + // color: "rgba(142, 187, 255, 1)", + // }, + }, ], }; }; diff --git a/src/view/echarts_hygiene/eP7.vue b/src/view/echarts_hygiene/eP7.vue index 41f42a6..bd005dd 100644 --- a/src/view/echarts_hygiene/eP7.vue +++ b/src/view/echarts_hygiene/eP7.vue @@ -3,7 +3,7 @@