| | |
| | | |
| | | // 综合看板图 |
| | | 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) { |
| | |
| | | } |
| | | } |
| | | |
| | | 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', |
| | |
| | | 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 + '} ' |
| | |
| | | } |
| | | }, |
| | | { |
| | | show: true, |
| | | show: false, |
| | | inverse: true, |
| | | data: data, |
| | | data: valdata, |
| | | axisLabel: { |
| | | textStyle: { |
| | | fontSize: 20, |
| | | fontSize: 12, |
| | | color: '#fff' |
| | | } |
| | | }, |
| | |
| | | }, |
| | | 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}%', |
| | | // } |
| | | } |
| | | } |
| | | ] |