parent
59cc2a5d36
commit
d9ed2349bf
@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* @Author: your name
|
||||||
|
* @Date: 2021-11-11 15:12:31
|
||||||
|
* @LastEditTime: 2021-11-11 16:42:55
|
||||||
|
* @LastEditors: Please set LastEditors
|
||||||
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
* @FilePath: /data-show/src/api/ModelComparison/index.js
|
||||||
|
*/
|
||||||
|
import httpService from "@/request"
|
||||||
|
|
||||||
|
// 事件-事件分类
|
||||||
|
export function getEventsSeriesNameC(params) {
|
||||||
|
let obj = Object.assign({action: 'getEventsSeriesNameC',sType: 'HotEvent0528'}, params)
|
||||||
|
return httpService({
|
||||||
|
url: `/api/v6.ashx`,
|
||||||
|
method: 'post',
|
||||||
|
data: obj,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/x-www-form-urlencoded'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,174 @@
|
|||||||
|
/*
|
||||||
|
* @Author: your name
|
||||||
|
* @Date: 2021-11-11 15:26:24
|
||||||
|
* @LastEditTime: 2021-11-11 15:27:33
|
||||||
|
* @LastEditors: Please set LastEditors
|
||||||
|
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
* @FilePath: /data-show/src/views/ModelComparison/brandEventComparison/opt1.js
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* @Author: your name
|
||||||
|
* @Date: 2021-10-15 15:15:27
|
||||||
|
* @LastEditTime: 2021-11-11 15:25:56
|
||||||
|
* @LastEditors: Please set LastEditors
|
||||||
|
* @Description: In User Settings Edit
|
||||||
|
* @FilePath: /data-show/src/views/BrandComparison/channelDistribution/opt.js
|
||||||
|
*/
|
||||||
|
import { bigNumberTransform } from "@/utils/gol/dataTool"
|
||||||
|
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 = []) {
|
||||||
|
/*series: [
|
||||||
|
{
|
||||||
|
name: '奥迪',
|
||||||
|
type: 'bar',
|
||||||
|
barGap: 0,
|
||||||
|
barWidth: 16,
|
||||||
|
emphasis: {
|
||||||
|
focus: 'series'
|
||||||
|
},
|
||||||
|
data: [320, 332, 301, 334, 390, 400]
|
||||||
|
},*/
|
||||||
|
let arr = [];
|
||||||
|
dataList.forEach(e => {
|
||||||
|
let o = {
|
||||||
|
name: e.key,
|
||||||
|
type: 'bar',
|
||||||
|
barWidth: 16,
|
||||||
|
barGap: '9%',
|
||||||
|
emphasis: {
|
||||||
|
focus: 'series'
|
||||||
|
},
|
||||||
|
data: e.value
|
||||||
|
};
|
||||||
|
arr.push(o)
|
||||||
|
})
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
export default function createOpt(dataList = [],brandList = []) {
|
||||||
|
let info = createData(dataList);
|
||||||
|
return {
|
||||||
|
grid: {
|
||||||
|
top: 56,
|
||||||
|
left: 10,
|
||||||
|
right: "5%",
|
||||||
|
bottom: 10,
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
color: colors,
|
||||||
|
legend: {
|
||||||
|
data: brandList,
|
||||||
|
textStyle: { //图例文字的样式
|
||||||
|
color: '#fff',
|
||||||
|
fontSize: 10
|
||||||
|
},
|
||||||
|
y: 12,
|
||||||
|
x: 16,
|
||||||
|
itemWidth: 12,
|
||||||
|
itemHeight: 12
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
backgroundColor: "#08182F",
|
||||||
|
color: "#fff",
|
||||||
|
borderColor: "#3373CC",
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", //设置文字颜色
|
||||||
|
},
|
||||||
|
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
|
||||||
|
},
|
||||||
|
xAxis: [
|
||||||
|
{
|
||||||
|
type: 'category',
|
||||||
|
axisTick: {
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
axisLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
color: "#fff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data: ['新闻', '论坛', '微信', 'APP', '微博', "其他"]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: 'value',
|
||||||
|
axisLine: {
|
||||||
|
show: false,
|
||||||
|
lineStyle: {
|
||||||
|
color: "#FFF",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
formatter: (value) => {
|
||||||
|
let str = bigNumberTransform(value);
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
splitLine: {
|
||||||
|
lineStyle: {
|
||||||
|
type: "dashed", // y轴分割线类型
|
||||||
|
color: "#012b4b",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: info
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue