eachtres 相关 常用记录
作者:互联网
1. grid: { //图标所占div的面积
top: "15%",
left:"0%",
right:"9%",
bottom:"5%",
containLabel: true
},
2. legend: { // 展示的小图标,
icon: "rect",
right: 60,
top: 10,
itemWidth: 15, // 设置宽度
itemHeight: 15, // 设置高度
},
3, tooltip: { //类似于玉如展示的model框
trigger: "axis",
formatter: function(params) {
let html = '';
params.forEach(v => {
// console.log(v)
html += `<div style="color: #666;font-size: 14px;line-height: 24px">
<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;">${color[v.componentIndex]};"></span>
${v.seriesName}.${v.name}
<span style="color:${color[v.componentIndex]};font-weight:700;font-size: 18px">${v.value}</span>
`;
})
return html
},
extraCssText: 'background: #fff; border-radius: 0;box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);color: #333;',
axisPointer: {
type: 'line',
lineStyle:{
type: 'linear',
width:2
}
}
},
4. xAxis: [{
axisLabel: {
textStyle: { //X轴文字颜色
color: "#474A4F"
},
// formatter: function(val) {
// let strs = val.split(''); //字符串数组
// let str = ''
// for(let i = 0, s; s = strs[i++];) { //遍历字符串数组
// str += s;
// if(!(i % 4)) str += '\n'; //按需要求余
// }
// return str
// }
},
axisLine: { //刻度线的颜色
lineStyle: {
color: "rgba(107,107,107,0.37)",
},
},
}]
5. yAxis: [{ }] 里面的 splitLine // 意思是展示虚线
splitLine: { lineStyle: { type: "dashed", color: "rgba(131,101,101,0.2)", } },
splitLine: { lineStyle: { type: "dashed", color: "rgba(131,101,101,0.2)", } },
标签:常用,rgba,记录,color,let,eachtres,str,lineStyle,107 来源: https://www.cnblogs.com/heibin/p/14173994.html