...
|
...
|
@@ -16,6 +16,7 @@ export default { |
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
kpiUnit:'',
|
|
|
options: {
|
|
|
color: [],
|
|
|
grid: {},
|
...
|
...
|
@@ -27,7 +28,7 @@ export default { |
|
|
},
|
|
|
tooltip: {
|
|
|
trigger: "axis",
|
|
|
formatter: "{a} <br/>{b} : {c}%"
|
|
|
formatter: "{a} <br/>{b} : {c} '%'"
|
|
|
},
|
|
|
legend: {
|
|
|
textStyle: {
|
...
|
...
|
@@ -140,7 +141,7 @@ export default { |
|
|
let optionsData=this.optionsData;
|
|
|
if(this.optionsData.dataType=="dynamicData"){
|
|
|
//改变参数值-月季度年,重新加载动态数据--待测
|
|
|
this.optionsData.dynamicData.contextData.btnCode=val;
|
|
|
this.optionsData.dynamicData.contextData.time=val;
|
|
|
this.editorOptions();
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -224,7 +225,8 @@ export default { |
|
|
lineStyle: {
|
|
|
color: optionsSetup.splitLineColorX
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
boundaryGap:['1','2']//坐标轴两边留白,为false则从0开始
|
|
|
};
|
|
|
this.options.xAxis = xAxis;
|
|
|
},
|
...
|
...
|
@@ -348,12 +350,43 @@ export default { |
|
|
// tooltip 设置
|
|
|
setOptionsTooltip() {
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
let that=this;
|
|
|
const tooltip = {
|
|
|
trigger: "axis",
|
|
|
show: true,
|
|
|
textStyle: {
|
|
|
color: optionsSetup.lineColor,
|
|
|
fontSize: optionsSetup.tipFontSize
|
|
|
},
|
|
|
formatter:function (param) {
|
|
|
let kpiName=optionsSetup.titleText;
|
|
|
// 鼠标悬浮线上提示
|
|
|
// 顶部提示
|
|
|
let tips = '<table>';
|
|
|
if (param.length == 1) {
|
|
|
tips += "<tr><td style='text-align:left;' colspan='4'>" + param[0].name + "</td></tr>";
|
|
|
} else {
|
|
|
tips += "<tr><td style='text-align:left;' colspan='4'>" + kpiName + " " + param[0].name + "</td></tr>";
|
|
|
}
|
|
|
// 每一条提示
|
|
|
$.each(param, function (i, v) {
|
|
|
let kpiUnit='';
|
|
|
tips += "<tr><td>" + v.marker + "</td>";
|
|
|
tips += '<td style="text-align: left;">';
|
|
|
if (v.seriesName.indexOf('率') != -1) {
|
|
|
kpiUnit='%';
|
|
|
}else{
|
|
|
kpiUnit=that.kpiUnit
|
|
|
}
|
|
|
tips += (v.seriesName + ' ');
|
|
|
|
|
|
// tips += (v.seriesName && v.seriesName != '1' && !/series[0-9]+/.test(v.seriesName)) ? v.seriesName : '';
|
|
|
tips += '</td>'
|
|
|
tips += "<td>: </td><td>" + v.value;
|
|
|
tips += kpiUnit + "</td></tr>";
|
|
|
});
|
|
|
tips += '</table>'
|
|
|
return tips;
|
|
|
}
|
|
|
};
|
|
|
this.options.tooltip = tooltip;
|
...
|
...
|
@@ -474,11 +507,19 @@ export default { |
|
|
const series = val.series;
|
|
|
if(series && series.length>0){
|
|
|
series.map((item,index)=>{
|
|
|
if(index%2==0){
|
|
|
item.yAxisIndex= 1;
|
|
|
}else{
|
|
|
console.log("series",item)
|
|
|
if(item.name.indexOf('率')!=-1){
|
|
|
item.yAxisIndex= 1;
|
|
|
|
|
|
}else{
|
|
|
item.yAxisIndex=0;
|
|
|
|
|
|
}
|
|
|
// if(index%2==0){
|
|
|
// item.yAxisIndex= 1;
|
|
|
// }else{
|
|
|
// item.yAxisIndex=0;
|
|
|
// }
|
|
|
if(item.type=='bar'){
|
|
|
item.itemStyle= {
|
|
|
barBorderRadius: null
|
...
|
...
|
|