You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.5 KiB

3 years ago
//散点图
3 years ago
import {doStr} from "./text"
3 years ago
export default function multiColumnsOption(dx=[], dValue=[], dName=[]) {
const newData = [];
for(let i=0;i<dValue.length;i++) {
let obj = {
name: dName[i],
type: 'bar',
stack: 'total',
emphasis: {
focus: 'series'
},
data: dValue[i]
};
newData.push(obj)
};
return {
tooltip: {
trigger: 'axis',
3 years ago
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
fontSize: 9
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true,
3 years ago
axisPointer: {
// Use axis to trigger tooltip
type: 'line' // 'shadow' as default; can also be 'line' or 'shadow'
},
},
3 years ago
legend: {
icon: 'rectangle', //data图标样式
itemWidth: 8, //data图标大小
itemHeight: 8,
left: 5,
textStyle: {
3 years ago
fontSize: 8,
3 years ago
fontWeight: 400
},
},
3 years ago
//图表位置
grid: {
left: 50,
right: 30,
bottom: 30,
top: 50,
},
3 years ago
xAxis: {
type: 'category',
3 years ago
data: dx,
3 years ago
axisTick: {
show: false //去除刻度线
},
3 years ago
axisLabel: {
interval: 1,
3 years ago
textStyle: {
fontSize: 8
},
formatter:(value)=>{
let res=doStr(value,4)
return res
},
3 years ago
}
3 years ago
},
yAxis: {
3 years ago
type: 'value',
axisLabel: {
color: '#999999', //y轴文本颜色
textStyle: {
fontSize: 9
},
formatter: (value) => {
if (value >= 10000) {
value = (value / 10000) + '万';
}
return value;
}
},
3 years ago
},
series: newData
// series: [
// {
// name: 'Direct',
// type: 'bar',
// stack: 'total',
// emphasis: {
// focus: 'series'
// },
// data: [320, 302, 301, 334, 390, 330, 320]
// },
// ]
}
}