|
|
|
@ -7,10 +7,72 @@
|
|
|
|
|
* @FilePath: /data-show/src/views/BrandComparison/channelDistribution/opt.js
|
|
|
|
|
*/
|
|
|
|
|
import { bigNumberTransform } from "@/utils/gol/dataTool"
|
|
|
|
|
let colors = ['#3373CC', '#63AECC', '#54BF93', '#CC9D12', '#CC7733', "#CC5B41", '#452b74', '#71686f']
|
|
|
|
|
function createData(dataList = []) {
|
|
|
|
|
|
|
|
|
|
import * as echarts from "echarts";
|
|
|
|
|
let colors = [new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
|
{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: '#3373CC'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: '#071a32'
|
|
|
|
|
}
|
|
|
|
|
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
|
{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: '#63AECC'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: '#071a32'
|
|
|
|
|
}
|
|
|
|
|
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
|
{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: '#54BF93'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: '#071a32'
|
|
|
|
|
}
|
|
|
|
|
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
|
{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: '#CC9D12'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: '#071a32'
|
|
|
|
|
}
|
|
|
|
|
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
|
{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: '#CC7733'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: '#071a32'
|
|
|
|
|
}
|
|
|
|
|
], false), new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
|
|
{
|
|
|
|
|
offset: 0,
|
|
|
|
|
color: '#CC5B41'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
offset: 1,
|
|
|
|
|
color: '#071a32'
|
|
|
|
|
}
|
|
|
|
|
], false)]
|
|
|
|
|
|
|
|
|
|
function createData(dataList = [],dx = []) {
|
|
|
|
|
let arr = [];
|
|
|
|
|
dataList.forEach(e => {
|
|
|
|
|
let a = [];
|
|
|
|
|
let Data = e.Data || {};
|
|
|
|
|
dx.forEach(e => {
|
|
|
|
|
a.push(Data[e])
|
|
|
|
|
})
|
|
|
|
|
let o = {
|
|
|
|
|
name: e.Name,
|
|
|
|
|
type: 'bar',
|
|
|
|
@ -19,30 +81,37 @@ function createData(dataList = []) {
|
|
|
|
|
emphasis: {
|
|
|
|
|
focus: 'series'
|
|
|
|
|
},
|
|
|
|
|
data: [e.Data.新闻, e.Data.微信, e.Data.短视频, e.Data.APP, e.Data.论坛,e.Data.微博, e.Data.其他]
|
|
|
|
|
data: a
|
|
|
|
|
};
|
|
|
|
|
arr.push(o)
|
|
|
|
|
})
|
|
|
|
|
return arr;
|
|
|
|
|
}
|
|
|
|
|
export default function createOpt(dataList = [], brandList = []) {
|
|
|
|
|
let info = createData(dataList);
|
|
|
|
|
export default function createOpt(dataList = [],dx = [], brandList = []) {
|
|
|
|
|
let info = createData(dataList,dx);
|
|
|
|
|
return {
|
|
|
|
|
grid: {
|
|
|
|
|
top: "56px",
|
|
|
|
|
left: "16px",
|
|
|
|
|
right: "28px",
|
|
|
|
|
bottom: "16px",
|
|
|
|
|
left: 10,
|
|
|
|
|
right: '5%',
|
|
|
|
|
bottom: 10,
|
|
|
|
|
top: 52,
|
|
|
|
|
// top: "56px",
|
|
|
|
|
// left: "16px",
|
|
|
|
|
// right: "28px",
|
|
|
|
|
// bottom: "16px",
|
|
|
|
|
containLabel: true,
|
|
|
|
|
},
|
|
|
|
|
color: colors,
|
|
|
|
|
legend: {
|
|
|
|
|
data: brandList,
|
|
|
|
|
textStyle: { //图例文字的样式
|
|
|
|
|
color: '#fff'
|
|
|
|
|
color: '#fff',
|
|
|
|
|
fontSize: 10
|
|
|
|
|
},
|
|
|
|
|
y: 12,
|
|
|
|
|
x: 16
|
|
|
|
|
x: 16,
|
|
|
|
|
itemWidth: 12,
|
|
|
|
|
itemHeight: 12
|
|
|
|
|
},
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: "axis",
|
|
|
|
@ -66,7 +135,7 @@ export default function createOpt(dataList = [], brandList = []) {
|
|
|
|
|
color: "#fff",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
data: ['新闻', '微信', '短视频', 'APP','论坛', '微博', "其他"]
|
|
|
|
|
data: dx
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
yAxis: [
|
|
|
|
|