|
|
|
@ -7,48 +7,8 @@
|
|
|
|
|
* @FilePath: /data-show/src/views/BrandInsight/titsopo/opt.js
|
|
|
|
|
*/
|
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
|
// import { bigNumberTransform } from "@/utils/gol/dataTool"
|
|
|
|
|
let colors = ['#546fc5', '#91cb74', '#f9c857', '#ed6565', '#72bfde', '#3aa272', '#fb8351'];
|
|
|
|
|
function createData(ds = []) {
|
|
|
|
|
let arr = [];
|
|
|
|
|
for (let i = 0; i < ds.length; i++) {
|
|
|
|
|
let arr1 = ds[i];
|
|
|
|
|
for (let j = 0; j < arr1.length; j++) {
|
|
|
|
|
let n = arr.findIndex(ele => {
|
|
|
|
|
return ele.name === arr1[j].key;
|
|
|
|
|
})
|
|
|
|
|
if (n === -1) {
|
|
|
|
|
let obj =
|
|
|
|
|
{
|
|
|
|
|
name: arr1[j].key,
|
|
|
|
|
type: 'line',
|
|
|
|
|
symbol: 'none',
|
|
|
|
|
areaStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
opacity: 0.4,
|
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
|
|
|
|
|
offset: 0, color: colors[j] // 0% 处的颜色
|
|
|
|
|
}, {
|
|
|
|
|
offset: 1, color: '#000' // 100% 处的颜色
|
|
|
|
|
}]
|
|
|
|
|
),
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
emphasis: {
|
|
|
|
|
focus: 'series'
|
|
|
|
|
},
|
|
|
|
|
data: [arr1[j].value]
|
|
|
|
|
}
|
|
|
|
|
arr.push(obj)
|
|
|
|
|
} else {
|
|
|
|
|
arr[n].data.push(arr1[j].value)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default function createOpt(dx=[], ds=[],sTimeType = 20) {
|
|
|
|
|
let data = createData(ds)
|
|
|
|
|
return {
|
|
|
|
|
grid: {
|
|
|
|
|
left: 10,
|
|
|
|
@ -118,6 +78,21 @@ export default function createOpt(dx=[], ds=[],sTimeType = 20) {
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
series: data
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
data: ds,
|
|
|
|
|
type: 'line',
|
|
|
|
|
color: '#546fc5',
|
|
|
|
|
areaStyle: {normal: {
|
|
|
|
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: '#546fc5'
|
|
|
|
|
}, {
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: 'rgba(0,0,0,0)'
|
|
|
|
|
}]),
|
|
|
|
|
}}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|