feat:添加chart option选项

This commit is contained in:
zhangyu
2020-09-29 09:45:49 +08:00
parent d8b7c475db
commit 03e5937565
3 changed files with 51 additions and 21 deletions

View File

@@ -1229,15 +1229,27 @@
axiosArr = this.data.elements.map((ele) => {
const filterItem = ele;
let query = encodeURIComponent(filterItem.expression);
if(this.chartInfo.type==='line'||this.chartInfo.type==='bar'||this.chartInfo.type==='stackArea'){//如果是这三个 默认给connected
this.chartInfo.param.nullType=this.chartInfo.param.nullType||'connected';
query+='&nullType='+this.chartInfo.param.nullType;
}
return this.$get('/prom/api/v1/query_range?query='+query+"&start="+this.$stringTimeParseToUnix(startTime)+"&end="+this.$stringTimeParseToUnix(endTime)+'&step='+step);
});
} else if (type === 'dashboard') { // 概览模式,指标概览中使用
// 概览模式,需要区分单独一个和多个
if (this.stableFilter.chartCount === 'multiple') {
let query = encodeURIComponent(this.data.title);
if(this.chartInfo.type==='line'||this.chartInfo.type==='bar'||this.chartInfo.type==='stackArea'){//如果是这三个 默认给connected
this.chartInfo.param.nullType=this.chartInfo.param.nullType||'connected';
query+='&nullType='+this.chartInfo.param.nullType;
}
axiosArr = [this.$get('/prom/api/v1/query_range?query='+query+"&start="+this.$stringTimeParseToUnix(startTime)+"&end="+this.$stringTimeParseToUnix(endTime)+'&step='+step)];
} else {
let query = encodeURIComponent(this.data.elements[0].expression);
if(this.chartInfo.type==='line'||this.chartInfo.type==='bar'||this.chartInfo.type==='stackArea'){//如果是这三个 默认给connected
this.chartInfo.param.nullType=this.chartInfo.param.nullType||'connected';
query+='&nullType='+this.chartInfo.param.nullType;
}
axiosArr = [this.$get('/prom/api/v1/query_range?query='+query+"&start="+this.$stringTimeParseToUnix(startTime)+"&end="+this.$stringTimeParseToUnix(endTime)+'&step='+step)];
}
}
@@ -1677,7 +1689,7 @@
unit,
oldDot
}
}
},
},
mounted() {
this.firstLoad = false;