prod
lily.zhang 3 years ago
parent 326458bf72
commit 8c315898c7

@ -1,18 +1,19 @@
/*
* @Author: your name
* @Date: 2021-10-08 10:13:32
* @LastEditTime: 2021-10-29 15:55:16
* @LastEditTime: 2021-11-01 19:30:30
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/utils/gol/index.js
*/
import * as echarts from "echarts";
import { bigNumberTransform } from "@/utils/gol/dataTool"
export function createSingleColumnar(dx=[], ds=[], color='#3373CC') {
return {
grid: {
top: 16,
top: 20,
left: 10,
right: 10,
right: '5%',
bottom: 10,
containLabel: true,
},
@ -59,6 +60,12 @@ export function createSingleColumnar(dx=[], ds=[], color='#3373CC') {
color: "#FFF",
},
},
axisLabel: {
formatter: (value) => {
let str = bigNumberTransform(value);
return str;
}
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
@ -80,7 +87,11 @@ export function createSingleColumnar(dx=[], ds=[], color='#3373CC') {
textStyle: { //数值样式
color: '#fff',
fontSize: 14
}
},
formatter: (p) => {
let str = bigNumberTransform(p.value);
return str;
}
},
color: new echarts.graphic.LinearGradient(
0,

@ -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: {
//柱体的颜色
//右1000表示从正右开始向左渐变
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轴分割线类型

Loading…
Cancel
Save