fix:修改问题
1 图表legend部分:没有配置legend,图表按默认方式显示legend,应为 up{asset="1.1.1.1",datacenter="北京"}
2 单值类型图表,绝对值数据显示用整数
This commit is contained in:
@@ -926,13 +926,9 @@ export default {
|
||||
host = chartItem.elements[innerPos].expression;
|
||||
}
|
||||
//处理legend别名
|
||||
|
||||
let alias=this.$refs['editChart'+chartItem.id][0].dealLegendAlias(host,chartItem.elements[innerPos].legend);
|
||||
if(!alias || alias===''){
|
||||
alias = chartItem.elements[innerPos].expression;
|
||||
}
|
||||
if(alias){
|
||||
host = alias;
|
||||
alias = host;
|
||||
}
|
||||
legend.push({name:host+resIndex,alias:alias});
|
||||
// 图表中每条线的名字,去掉最后的逗号与空格:metric名称, 标签1=a,标签2=c
|
||||
|
||||
@@ -393,7 +393,7 @@ export default {
|
||||
this.data = chartItem;
|
||||
this.unit = chartDataFormat.getUnit(this.data.unit);
|
||||
if(Number(seriesItem)){
|
||||
let singleStatTmp =Number(seriesItem).toFixed(2);
|
||||
let singleStatTmp =parseFloat(Number(seriesItem).toFixed(2));
|
||||
this.serieSingleStat = chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(singleStatTmp,null,2);
|
||||
}else {
|
||||
this.serieSingleStat =seriesItem;
|
||||
@@ -420,7 +420,7 @@ export default {
|
||||
this.data = chartItem;
|
||||
this.unit = chartDataFormat.getUnit(this.data.unit);
|
||||
if(Number(seriesItem)){
|
||||
let singleStatTmp =Number(seriesItem).toFixed(2);
|
||||
let singleStatTmp =parseFloat(Number(seriesItem).toFixed(2));//parseFloat :如果没有小数点,或者小数点后都是零,parseFloat() 会返回整数。
|
||||
this.serieSingleStat = chartDataFormat.getUnit(chartItem.unit?chartItem.unit:2).compute(singleStatTmp,null,2);
|
||||
}else {
|
||||
this.serieSingleStat =seriesItem;
|
||||
|
||||
@@ -427,10 +427,7 @@
|
||||
//处理legend别名
|
||||
let alias = this.dealLegendAlias(host, chartItem.elements[innerPos].legend);
|
||||
if (!alias || alias === '') {
|
||||
alias = chartItem.elements[innerPos].expression;
|
||||
}
|
||||
if (alias) {
|
||||
host = alias;
|
||||
alias = host;
|
||||
}
|
||||
legend.push({name: host + resInnerPos, alias: alias});
|
||||
// 图表中每条线的名字,去掉最后的逗号与空格:metric名称, 标签1=a,标签2=c
|
||||
@@ -1136,10 +1133,7 @@
|
||||
}
|
||||
let alias=this.dealLegendAlias(host,this.chart.elements[pos].legend);
|
||||
if(!alias || alias===''){
|
||||
alias = this.chart.elements[pos].expression;
|
||||
}
|
||||
if(alias){
|
||||
host = alias;
|
||||
alias = host;
|
||||
}
|
||||
legend.push({name:host+innerPos,alias:alias});
|
||||
// 图表中每条线的名字,去掉最后的逗号与空格:metric名称, 标签1=a,标签2=c
|
||||
|
||||
@@ -1400,10 +1400,7 @@
|
||||
}
|
||||
let alias=this.dealLegendAlias(host,this.data.elements[pos].legend);
|
||||
if(!alias || alias===''){
|
||||
alias = this.data.elements[pos].expression;
|
||||
}
|
||||
if(alias){
|
||||
host = alias;
|
||||
alias = host;
|
||||
}
|
||||
legend.push({name:host+innerPos,alias:alias});
|
||||
// 图表中每条线的名字,去掉最后的逗号与空格:metric名称, 标签1=a,标签2=c
|
||||
|
||||
Reference in New Issue
Block a user