From ceddb30c39100ac61cd254917428d12cdd23ca80 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Fri, 19 Jan 2024 21:54:22 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=9B=BE=E8=A1=A8=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=A2=9C=E8=89=B2=E9=94=99=E8=AF=AF=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin/default/js/index.init.js | 111 ++++++++++--------- 1 file changed, 60 insertions(+), 51 deletions(-) diff --git a/public/static/admin/default/js/index.init.js b/public/static/admin/default/js/index.init.js index 52f79df0c..47a41d22c 100644 --- a/public/static/admin/default/js/index.init.js +++ b/public/static/admin/default/js/index.init.js @@ -116,24 +116,27 @@ function EchartsStyle (data, radius) { } var new_data = data.map(function (item, index) { - var item_style = { - itemStyle: { - borderRadius: borderRadius, // 设置柱状图边框的圆角大小,单位为像素 - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ - offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 - }, { - offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 - }]) - }, - areaStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ - offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 - }, { - offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 - }]) - }, + if((gradient_color[index] || null) != null) { + var item_style = { + itemStyle: { + borderRadius: borderRadius, // 设置柱状图边框的圆角大小,单位为像素 + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 + }, { + offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 + }]) + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 + }, { + offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 + }]) + }, + } + return Object.assign({}, item, item_style); } - return Object.assign({}, item, item_style); + return item; }); return new_data; }; @@ -556,24 +559,27 @@ function EchartsNewUser (name_arr, data) { ] var borderRadius = [40, 40, 0, 0]; var new_data = data.map(function (item, index) { - var item_style = { - itemStyle: { - borderRadius: borderRadius, // 设置柱状图边框的圆角大小,单位为像素 - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ - offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 - }, { - offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 - }]) - }, - areaStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ - offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 - }, { - offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 - }]) - }, + if((gradient_color[index] || null) != null) { + var item_style = { + itemStyle: { + borderRadius: borderRadius, // 设置柱状图边框的圆角大小,单位为像素 + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 + }, { + offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 + }]) + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 + }, { + offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 + }]) + }, + } + return Object.assign({}, item, item_style); } - return Object.assign({}, item, item_style); + return item; }); var chart = echarts.init(document.getElementById('echarts-new-user'), 'macarons'); var option = { @@ -653,24 +659,27 @@ function EchartsBuyUser (name_arr, data) { ] var borderRadius = [40, 40, 0, 0]; var new_data = data.map(function (item, index) { - var item_style = { - itemStyle: { - borderRadius: borderRadius, // 设置柱状图边框的圆角大小,单位为像素 - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ - offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 - }, { - offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 - }]) - }, - areaStyle: { - color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ - offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 - }, { - offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 - }]) - }, + if((gradient_color[index] || null) != null) { + var item_style = { + itemStyle: { + borderRadius: borderRadius, // 设置柱状图边框的圆角大小,单位为像素 + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 + }, { + offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 + }]) + }, + areaStyle: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, color: gradient_color[index][0] // 渐变色从正上方开始,颜色为#42b983 + }, { + offset: 1, color: gradient_color[index][1] // 指100%处的颜色,颜色为#4a82c9 + }]) + }, + } + return Object.assign({}, item, item_style); } - return Object.assign({}, item, item_style); + return item; }); var chart = echarts.init(document.getElementById('echarts-buy-user'), 'macarons'); var option = { -- GitLab