|
|
|
@ -1,12 +1,14 @@
|
|
|
|
|
/*
|
|
|
|
|
* @Author: your name
|
|
|
|
|
* @Date: 2021-10-09 11:01:19
|
|
|
|
|
* @LastEditTime: 2021-10-28 15:33:03
|
|
|
|
|
* @LastEditTime: 2021-10-29 10:46:31
|
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
|
* @Description: In User Settings Edit
|
|
|
|
|
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
|
|
|
|
|
*/
|
|
|
|
|
let colors = ['#3572c5', '#589ab8', '#439e7e', '#a78214', '#995d2d', "#a54347", '#452b74', '#71686f']
|
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
|
let colors = ['#CC7733', '#CC9D12','#54BF93','#63AECC','#3373CC', "#c1c487", '#46914a', '#3fbfc5']
|
|
|
|
|
|
|
|
|
|
function createData(ds = []) {
|
|
|
|
|
let arr = [];
|
|
|
|
|
for (let i = 0; i < ds.length; i++) {
|
|
|
|
@ -21,9 +23,29 @@ function createData(ds = []) {
|
|
|
|
|
name: arr1[j].key,
|
|
|
|
|
type: 'bar',
|
|
|
|
|
stack: 'total',
|
|
|
|
|
barWidth: 24,
|
|
|
|
|
barWidth: 20,
|
|
|
|
|
emphasis: {
|
|
|
|
|
focus: 'series'
|
|
|
|
|
},
|
|
|
|
|
itemStyle:{
|
|
|
|
|
normal:{
|
|
|
|
|
//柱体的颜色
|
|
|
|
|
//右,下,左,上(1,0,0,0)表示从正右开始向左渐变
|
|
|
|
|
color: function(params){
|
|
|
|
|
console.log(params);
|
|
|
|
|
return new echarts.graphic.LinearGradient(0,0,0,1,[
|
|
|
|
|
{
|
|
|
|
|
offset:0,
|
|
|
|
|
color:params.color
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset:1,
|
|
|
|
|
color:'#000'
|
|
|
|
|
}
|
|
|
|
|
],false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
data: [arr1[j].value]
|
|
|
|
|
}
|
|
|
|
|