|
|
@ -98,8 +98,8 @@ export default {
|
|
|
|
this.setOptionsY();
|
|
|
|
this.setOptionsY();
|
|
|
|
this.setOptionsTop();
|
|
|
|
this.setOptionsTop();
|
|
|
|
this.setOptionsTooltip();
|
|
|
|
this.setOptionsTooltip();
|
|
|
|
//this.setOptionsMargin();
|
|
|
|
this.setOptionsMargin();
|
|
|
|
//this.setOptionsLegend();
|
|
|
|
this.setOptionsLegend();
|
|
|
|
//this.setOptionsColor();
|
|
|
|
//this.setOptionsColor();
|
|
|
|
this.setOptionsData();
|
|
|
|
this.setOptionsData();
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -121,7 +121,6 @@ export default {
|
|
|
|
fontWeight: optionsCollapse.subTextFontWeight,
|
|
|
|
fontWeight: optionsCollapse.subTextFontWeight,
|
|
|
|
fontSize: optionsCollapse.subTextFontSize
|
|
|
|
fontSize: optionsCollapse.subTextFontSize
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
this.options.title = title;
|
|
|
|
this.options.title = title;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// X轴设置
|
|
|
|
// X轴设置
|
|
|
@ -216,18 +215,18 @@ export default {
|
|
|
|
this.options.series = series;
|
|
|
|
this.options.series = series;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// tooltip 提示语设置,鼠标放置显示
|
|
|
|
// tooltip 提示语设置,鼠标放置显示
|
|
|
|
setOptionsTooltip() {
|
|
|
|
setOptionsTooltip() {
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
const tooltip = {
|
|
|
|
const tooltip = {
|
|
|
|
trigger: "item",
|
|
|
|
trigger: "item",
|
|
|
|
show: true,
|
|
|
|
show: true,
|
|
|
|
textStyle: {
|
|
|
|
textStyle: {
|
|
|
|
color: optionsCollapse.lineColor,
|
|
|
|
color: optionsCollapse.lineColor,
|
|
|
|
fontSize: optionsCollapse.tipsFontSize
|
|
|
|
fontSize: optionsCollapse.tipsFontSize
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.options.tooltip = tooltip;
|
|
|
|
this.options.tooltip = tooltip;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 边距设置
|
|
|
|
// 边距设置
|
|
|
|
setOptionsMargin() {
|
|
|
|
setOptionsMargin() {
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
@ -245,15 +244,14 @@ export default {
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
const optionsCollapse = this.optionsSetup;
|
|
|
|
const legend = this.options.legend;
|
|
|
|
const legend = this.options.legend;
|
|
|
|
legend.show = optionsCollapse.isShowLegend;
|
|
|
|
legend.show = optionsCollapse.isShowLegend;
|
|
|
|
legend.left = optionsCollapse.lateralPosition == "left" ? 0 : "auto";
|
|
|
|
legend.left = optionsCollapse.lateralPosition;
|
|
|
|
legend.right = optionsCollapse.lateralPosition == "right" ? 0 : "auto";
|
|
|
|
|
|
|
|
legend.top = optionsCollapse.longitudinalPosition == "top" ? 0 : "auto";
|
|
|
|
legend.top = optionsCollapse.longitudinalPosition == "top" ? 0 : "auto";
|
|
|
|
legend.bottom =
|
|
|
|
legend.bottom =
|
|
|
|
optionsCollapse.longitudinalPosition == "bottom" ? 0 : "auto";
|
|
|
|
optionsCollapse.longitudinalPosition == "bottom" ? 0 : "auto";
|
|
|
|
legend.orient = optionsCollapse.layoutFront;
|
|
|
|
legend.orient = optionsCollapse.layoutFront;
|
|
|
|
legend.textStyle = {
|
|
|
|
legend.textStyle = {
|
|
|
|
color: optionsCollapse.lengedColor,
|
|
|
|
color: optionsCollapse.lengedColor,
|
|
|
|
fontSize: optionsCollapse.fontSize
|
|
|
|
fontSize: optionsCollapse.lengedFontSize
|
|
|
|
};
|
|
|
|
};
|
|
|
|
legend.itemWidth = optionsCollapse.lengedWidth;
|
|
|
|
legend.itemWidth = optionsCollapse.lengedWidth;
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -301,6 +299,15 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return newArr;
|
|
|
|
return newArr;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
//获取堆叠样式
|
|
|
|
|
|
|
|
getStackStyle() {
|
|
|
|
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
|
|
|
|
let style = ""
|
|
|
|
|
|
|
|
if (optionsSetup.stackStyle == "upDown") {
|
|
|
|
|
|
|
|
style = "total"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return style
|
|
|
|
|
|
|
|
},
|
|
|
|
//静态数据
|
|
|
|
//静态数据
|
|
|
|
staticDataFn(val) {
|
|
|
|
staticDataFn(val) {
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
|
const optionsSetup = this.optionsSetup;
|
|
|
@ -329,8 +336,9 @@ export default {
|
|
|
|
type: "bar",
|
|
|
|
type: "bar",
|
|
|
|
data: data,
|
|
|
|
data: data,
|
|
|
|
barGap: "0%",
|
|
|
|
barGap: "0%",
|
|
|
|
barWidth : optionsSetup.maxWidth,
|
|
|
|
stack: this.getStackStyle(),
|
|
|
|
label : {
|
|
|
|
barWidth: optionsSetup.maxWidth,
|
|
|
|
|
|
|
|
label: {
|
|
|
|
show: optionsSetup.isShow,
|
|
|
|
show: optionsSetup.isShow,
|
|
|
|
position: "top",
|
|
|
|
position: "top",
|
|
|
|
distance: 10,
|
|
|
|
distance: 10,
|
|
|
|