/* * @Author: your name * @Date: 2021-10-12 15:32:24 * @LastEditTime: 2021-11-19 19:50:21 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: /data-show/src/views/BrandInsight/weiboVolumeTrend/opt.js */ import * as echarts from "echarts"; import { bigNumberTransform } from "@/utils/gol/dataTool" export default function createOpt(dx = [], ds = [], hotIndex = []) { let mark = []; hotIndex.forEach(ele => { let obj = { name: 'Max', xAxis: ele, yAxis: ds[ele], symbol: 'pin', symbolSize: 16, symbolOffset: [0, '-70%'], } mark.push(obj) }) return { grid: { top: 16, left: 16, right: "5%", bottom: 10, containLabel: true, }, tooltip: { trigger: "axis", backgroundColor: "#08182F", color: "#fff", borderColor: "#3373CC", textStyle: { color: "#fff", //设置文字颜色 }, extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;" }, xAxis: { type: 'category', boundaryGap: false, axisTick: { show: false, }, axisLabel: { formatter: (value) => { let rex = "00:00:00"; let isCont = false; let str = value; for(let i = 0;i { let str = bigNumberTransform(value); return str; } }, splitLine: { lineStyle: { type: "dashed", // y轴分割线类型 color: "#012b4b", }, }, }, 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)' }]), }}, markPoint: { data: mark, } } ] }; }