|
|
|
@ -1,11 +1,15 @@
|
|
|
|
|
/*
|
|
|
|
|
* @Author: your name
|
|
|
|
|
* @Date: 2021-10-09 11:01:19
|
|
|
|
|
* @LastEditTime: 2021-10-26 10:40:34
|
|
|
|
|
* @LastEditTime: 2021-11-01 19:26:21
|
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
|
* @Description: In User Settings Edit
|
|
|
|
|
* @FilePath: /data-show/src/views/Index/spreadTheSound/opt.js
|
|
|
|
|
*/
|
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
|
import { bigNumberTransform } from "@/utils/gol/dataTool"
|
|
|
|
|
let colors = ['rgba(203,118,58,1)', 'rgba(202,156,17,1)', 'rgba(90,203,156,1)', 'rgba(99,173,204,1)', 'rgba(55,113,190,1)', "rgba(138,191,66,1)", 'rgba(181,191,67,1)', 'rgba(203,91,65,1)']
|
|
|
|
|
let colors2 = ['rgba(203,118,58,0.6)', 'rgba(202,156,17,0.6)', 'rgba(90,203,156,0.6)', 'rgba(99,173,204,0.6)', 'rgba(55,113,190,0.6)', "rgba(138,191,66,0.6)", 'rgba(181,191,67,0.6)', 'rgba(203,91,65,0.6)']
|
|
|
|
|
function createData(ds = []) {
|
|
|
|
|
let arr = [];
|
|
|
|
|
for (let i = 0; i < ds.length; i++) {
|
|
|
|
@ -21,9 +25,29 @@ function createData(ds = []) {
|
|
|
|
|
type: 'bar',
|
|
|
|
|
stack: 'total',
|
|
|
|
|
barWidth: 24,
|
|
|
|
|
barGap: "-100%",
|
|
|
|
|
emphasis: {
|
|
|
|
|
focus: 'series'
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
//柱体的颜色
|
|
|
|
|
//右,下,左,上(1,0,0,0)表示从正右开始向左渐变
|
|
|
|
|
color: function () {
|
|
|
|
|
return new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
|
{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: colors[j]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: colors2[j]
|
|
|
|
|
}
|
|
|
|
|
], false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
data: [arr1[j].value]
|
|
|
|
|
}
|
|
|
|
|
arr.push(obj)
|
|
|
|
@ -82,6 +106,12 @@ export default function createOpt(dx=[], ds=[]) {
|
|
|
|
|
color: "#fff",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
axisLabel: {
|
|
|
|
|
formatter: (value) => {
|
|
|
|
|
let str = bigNumberTransform(value);
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
splitLine: {
|
|
|
|
|
lineStyle: {
|
|
|
|
|
type: "dashed", // y轴分割线类型
|
|
|
|
|