From ebe7bf1b9118958f6a93406305f5728bfd5d90c9 Mon Sep 17 00:00:00 2001 From: 小小儁爺 <1694218219@qq.com> Date: 星期一, 03 三月 2025 10:33:24 +0800 Subject: [PATCH] 1. 综合看板修改编码 --- src/utils/myEcharts.js | 49 +++++++++++++++++-------------------------------- 1 files changed, 17 insertions(+), 32 deletions(-) diff --git a/src/utils/myEcharts.js b/src/utils/myEcharts.js index 3fb285e..415693e 100644 --- a/src/utils/myEcharts.js +++ b/src/utils/myEcharts.js @@ -356,13 +356,13 @@ // 缁煎悎鐪嬫澘鍥� export function bar02(dataArr, titlenameArr) { - // const data = [700, 600, 50, 40, 30] - // const titlename = ['500ml鎻愭墜鐩栧挅鍟℃澂 钃濊壊 鍠峰', '500ml鎻愭墜鐩栧挅鍟℃澂 钃濊壊 鍠峰', '灏哄', '棰滆壊', '澶у皬'] + // const data = [70, 60, 50, 40, 30] + // const titlename = ['澶栬鍒掍激', '琛ㄩ潰娌规薄', '灏哄', '棰滆壊', '澶у皬'] // const data = val.map(i => i.cont) // const titlename = val.map(i => i.name) - const data = dataArr.filter((item, index) => index < 5) + const data = dataArr.filter((item, index) => index < 10) - const titlename = titlenameArr.filter((item, index) => index < 5) + const titlename = titlenameArr.filter((item, index) => index < 10) const length = titlename.length if (titlename.length < 5) { @@ -371,13 +371,14 @@ } } - console.log(titlename, 123) - - // const valdata = [683, 500, 400, 300, 200] + const valdata = [683, 500, 400, 300, 200] // const myColor = ['#FF0000', '#FF5511', '#FF8800', '#FFBB00', '#FFFF00'] // const myColor = ['#0000FF'] // const myColor = ['#7af5f5', '#00FFFF', '#00FFFF', '#00FFFF', '#00FFFF'] - const myColor = ['rgba(122,245,245,1)', 'rgba(122,245,245,0.95)', 'rgba(122,245,245,0.9)', 'rgba(122,245,245,0.85)', 'rgba(122,245,245,0.8)'] + const myColor = [ + 'rgba(122,245,245,1)', 'rgba(122,245,245,0.95)', 'rgba(122,245,245,0.9)', 'rgba(122,245,245,0.85)', 'rgba(122,245,245,0.8)', + 'rgba(122,245,245,0.75)', 'rgba(122,245,245,0.7)', 'rgba(122,245,245,0.65)', 'rgba(122,245,245,0.6)', 'rgba(122,245,245,0.55)' + ] const option = { animation: false, backgroundColor: 'transparent', @@ -423,16 +424,11 @@ show: false }, axisLabel: { - show: false, // color: '#fff', color: function(value, index) { return value === '0' ? 'transparent' : '#fff' }, - verticalAlign: 'bottom', - // align: 'left', - // margin: 80, fontSize: 20, - // formatter: function(value, index) { // return [ // '{lg|' + (index + 1) + '銆� }' + '{title|' + value + '} ' @@ -462,12 +458,12 @@ } }, { - show: true, + show: false, inverse: true, - data: data, + data: valdata, axisLabel: { textStyle: { - fontSize: 20, + fontSize: 12, color: '#fff' } }, @@ -502,24 +498,13 @@ }, label: { normal: { - color: '#fff', show: true, - position: [0, '-20px'], - textStyle: { - fontSize: 16 - }, - formatter: function(a, b) { - return a.name - } + position: 'right', + formatter: '{c}', + fontSize: 20, + color: '#fff' + // formatter: '{c}%', } - // normal: { - // show: true, - // position: 'right', - // formatter: '{c}', - // fontSize: 20, - // color: '#fff' - // // formatter: '{c}%', - // } } } ] -- Gitblit v1.9.3